The problem is caused by the variable SYMROOT in the *.xcodeproj/project.pbxproj file. The presence of this variable forces xcodebuild to use the legacy option instead of default, unless an WorkspaceSettings.xcsettings configuration file exists for the user and overrides it.
The solution is to open the project file in a text editor, and delete all lines that contain the variable name SYMROOT. After that opening a freshly cloned project will result in build location being set to default.
For example, in my project file, I had to remove all lines that looked like this:
SYMROOT = Build