Looking at libraries/clean-source-libs.sh I think I know what went wrong.
From the base directory run
git checkout libraries
to restore the extra files deleted by ./libraries/clean-source-libs.sh, then try again.
if you pass --with-system-cxxtest to ./libraries/build-source-libs.sh, then you have to do the same to build/workspaces/update-workspaces.sh and have the cxxtest package installed via package manager.
Edit: https://gitea.wildfiregames.com/0ad/0ad/pulls/7130