Just realised you can see your inputs when in docking mode, and it was clearly a trim problem. I dont know why Alt+Z doesnt reset it, or why the both craft suddenly gained loads of yaw trim without me holding alt, but with the issue visible I was able to fix it.
I launched a vessel into orbit - a very simple one - and the vessel constantly acts as if I'm holding the D key, and will keep spinning until I disable the reaction wheels. Alt-Z to try and reset the trim doesnt work. I sent another vessel to dock with it, and that vessel was fine until it got within simulation radius of the previous one, then it did exactly the same thing: It will spin like I'm holding D until I turn the reaction wheels off. Anyone else ever had this bug?
(Windows x64, Steam, 1.12.5.3190)