I had the same issue with MATLAB either crashing on start with the "error 126" message, or crashing when plotting anything on the screen, when running through Remote Desktop.
After many different trials, I figured out how to solve the issue:
- Remote login to the host
- Log yourself out fully (start button, click on user icon, "sign out")
- Remote login to host again
- Lauch MATLAB
What I understand is that if the current session was started locally, you need to fully sign out, then log back in again remotely, in order for the graphics settings to be properly configured.