We tried that tip but it did not complete successfully at first, but with a different error
RunAs configuration completed.
Error exporting user Configuration file.
Then we tried again without the --writeconfig... and it worked fine
Windows Server 2022 does not have a c:\temp directory out of the box
Reference command line from esri doc:
configureserviceaccount.bat --username mydomain\username --password difficultpsswd --writeconfig c:\temp\domainaccountconfig.xml
Then we tried again after creating a folder the username can write to and including the --writeconfig... and it worked fine too