Actually I really know nothing about the politics of any country except the US and UK. Any pronouncements I make about any other country is just me mostly talking out my ass. This is true of most Americans who talk about the politics of other countries.
HOWEVER, this is a blog, and I get to talk out my ass sometimes. Macron's electoral problems are hardly a secret. "Do unpopular things and people will love us anyway because we are smart and sensible" only works if you define "people" as "certain powerful interests and their various aligned news outlets."
As for why he called the election: either he's fine being president with a far right parliament, for whatever reasons, or he thought "I am the man to protect you from the extremes ON BOTH SIDES" was a winner and well...