systemsetup throws error

I run some scripts to set up certain things when building a computer. Recently (ala Big Sur+) the specific commands to set things using systemsetup throw an error. It worked perfectly in the past, so something has changed, in fact I seem to recall it worked in earlier versions of BigSur.

This is the error: 2022-04-09 07:07:33.282 systemsetup[2738:43831] ### Error:2 File:/System/Volumes/Data/SWE/macOS/BuildRoots/9dc5c14c79/Library/Caches/com.apple.xbs/Sources/Admin/Admin-876.2/InternetServices.m Line:379

Here is a code example:

#!/usr/bin/perl $TZ = "America/New_York"; $CMD -settimezone $TZ; $curTZ = $CMD -gettimezone; print "\n\n$curTZ\n\n";

Notes: 1 even though it throws the error, it still sets the timezone correctly. 2 the error is the same no matter what "-set" verb is used; timezone, timeserver, computersleep, etc. 3 It does the same on both Intel and M1 machines.

Any suggestions?

systemsetup throws error
 
 
Q