This is still an issue for me and my son.
I don't get an error message. My issue is the box with the code and the link never pops up to allow for us to link our MS account to Minecraft on the Switch.
This is still an issue for me and my son.