There was a parliament election, with three blocks each gaining roughly a third of the seats.
The block that won the most seats (but not enough to have a majority) immediately declared they would never compromise/ally with anyone else. Essentially, if they were called on to form a government, they were almost certainly going to be immediately censured.
So Macron, rightly or wrongly depending on who you ask, decided to not call on them since he estimated it was bound to fail and waste time. Instead, he nominated someone from a (now) minor political force because, at least in theory, they were enough people willing to negotiate with them to form a majority. Looks like it didn't work in the end and now France will be stuck because no one is willing to compromise.
Broadly Parliament is split into 3 camps, the left, the centr, and the right, all pretty much even. Any two could work together as a coalition and agree to a leader, but that is proving harder.