I have a third party dock, but I’ve experienced a lot of the same issues you’ve mentioned. That said, the updates over the last year have improved things significantly for me.
When it comes to switching between gaming and desktop mode whilst docked I still have issues there. I usually disconnect the display whilst switching, just to be safe.
How are you running Minecraft? I’d recommend Prism launcher, and then installing the Controllable mod. It’s excellent - updates the UI and controls to match the console versions of Minecraft.