"The newest Sword & Shield update (v1.1.1) has fixed the crashing caused by 'maliciously crafted' Pokémon trades. It's fixed!"
As always, be wary of hacks, but the patch has apparently fixed the glitch that bricked your Y-COM if you got traded a malicious mon thru ST.
Source