+1 I’d love to see this fixed.
I think this is the same issue as the bug I reported here: Castle Auto-Targets Gates When Units Are Queued
I’ll note that this occurs anytime the front of the building’s production queue changes, not just when a unit is created.