You fail to note that the medallion system existed partially to limit traffic, pollution, car accidents, pedestrian accidents and all the other externalities caused by massive amounts of additional cars on the road. You can argue if it's a net benefit or not but you failing to even note it is telling.
Most bad policies have at least some reasonable sounding (often well-intentioned) justification for their existence, but that's not really relevant to the point I was making.
Well-intentioned bad policies usually just fail to account for unexpected outcomes, or they create perverse incentives that quickly overshadow the original goals and make things worse. In particularly nasty cases the reasonable sounding justification was never the goal (or even initially well-intentioned) and it's just a cover for the some other motive.
I'm not sure which was the case for medallions originally, maybe it's what you suggest - or maybe some people were just trying to lock in a monopoly they could exploit. The number of cars on the road would likely have been moderated by what the market could support without them. The creation of monopolies locked in place via legislation was not a good outcome and created lots of problems.
Now with Uber/Lyft operating, suddenly the taxi service in NYC has improved (they'll actually take you where you need to go, the credit cards machines are no longer mysteriously broken).