Got the same annoying problem, thank you for your research!
Maybe creating an applescript or something similar could fix the problem? Watching the folder and just executing the sudo xcrun or maybe directly setting the correct permissions with sudo chmod 0770 file?
Edit: Have you filed a bug report with apple https://bugreport.apple.com ?
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: