This happened to me while running flutter build ipa via the remote ssh command line. I ran the same command inside the remote desktop session command line and build went through fine with code signing.
flutter build ipa