In late 2024 this is still an issue, as I discovered today. For me, just launching XCode and accepting the terms, etc. fixed the issue.