Maybe what happened is that once you become good at being a developer, you derived satisfaction from that even if you were working for someone else, or maybe you thought your "passion" was elsewhere.
This is the thesis of Cal Newport's book "So Good They Can’t Ignore You", summary here:
https://fourminutebooks.com/so-good-they-cant-ignore-you-sum...