By the time the EU actually first proposed regulation on the matter, which was only in 2020, there were in effect three ports on the phone market: the Apple Lightning was still used in iPhones, and the rest of the market was undergoing an orderly migration from the cheaper micro-USB port, to the more expensive but better USB-C port.
So yes, the free market was entirely responsible for transitioning from dozens of ports to 3 ports, and would have very likely eventually transitioned to 2 ports. The fact that the EU made recommendation to that effect years ago after the trend had begun that was purely voluntary is an entirely irrelevant datum.