I think it is incorrect to believe Einstein constantly failed at school. Early in life he had some language difficulties that will have masked his very real intellectual powers. He gained musical skill and took refuge in this. A tutor his family engaged for him introduced the idea of light in physics and this is where Einstein first began his theorising.
He did come out of school in Munich early, but this was to escape military call-up. You can imagine that with the right wing ideology already showing itself, he would not have wanted to be a jew in the military. He claimed nervous exhaustion and continued his education to university in Switzerland, where, of course, jews were safe.