All suggested fixed did not work for me.
As a workaround I added 1>&2 2>/dev/null so the error does not show and parsing the output of -list -json is now working again.
xcrun xcodebuild -quiet -list -json 1>&2 2>/dev/null
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: