Unsolicited advice: I think you're right, nobody will pay you for it. Every serious programmer interested in game dev writes engines as a hobby. Just search through GitHub. It's partly because it's just tech exploration fun..
If you're serious about games you should make a game. Build an engine too, but only build what you need for the game. This will guide you in making the countless tradeoffs necessary to build an actually shipping piece of software. Otherwise, it's just a tech demo with no constraints or commercial value.
The general game engines (Unity, Unreal, etc) that are commercially valuable spent a lot of time and effort on excruciatingly boring things: supporting a lot of file formats, having very stable tools, being very accessible for beginners, etc.