As others have said, this is overpowered, and yes, the sorcerer in particular looks to be pretty well shafted by the idea.
There is an alternative that might warrant consideration: in 3.5e there was a class called the erudite, which used psionic powers instead of magical spells, but for our purposes they amount to the same thing. The erudite had a mechanic called unique powers per day, which limited how many different powers they could use. It was a lot like 5e spell preparation, except you did not have to prepare in advance. Instead, when you used your first power of the day, that became one of your unique powers for the day. You could keep using that power as long as you wanted (and had spell slots power points to do so), and it would still be just one of your unique powers. If you wanted to use a different power, that would be your second unique power. And if you were out of unique powers for the day, you could only use those powers you had already used before. In effect, it was preparation-as-you-use-them, but still limited in the total number of different powers you could use.
The obvious problem here is that this is still massively more convenient and flexible than spell preparation is. That gives it a lot of power. The erudite was in the running for most powerful class in 3.5e, and the unique powers per day mechanic was a big part of why.
So if you wanted to swap your 5e wizard to use a unique spells per day mechanic instead of preparation, you would have to figure out how to balance that—probably by giving drastically fewer unique spells per day than the wizard would have spells to prepare. The wizard usually gets \$level + Int\$ spells prepared per day—I’m thinking I would probably give the wizard just \$\DeclareMathOperator{\or}{\textbf{or}}level \or Int\$, whichever is less, unique spells per day.