To go for maximal damage, you can combine flipping of magnetic poles, massive solar flare, and serious heat wave.
Immediate damage would be only to power grid, with no human casualties. But it will snowball from there:
Imagine 2006 Queens blackout in every major city in all over developed world. Huge amount of power-generating equipment is damaged or destroyed (fried), and if you are feeling nasty you can add failure of nuclear power stations, spewing radiation all over. Blow some chemical factories for diversity. You will be surprised how many are located close to dense populated areas like Indian Point, just 38 miles from NYC. So far you have radiation and no broadcasting (because broadcasting equipment was fried and has no power anyway. Guess what is next: huge panic.
In panic, people trying to escape to rural areas where is food. Well guess what: you cannot get gas at pump without electricity to pump it, and you have to pay cash. Yeah, this gets interesting. Because if you have a car I need, and I have a gun, after our meeting I have gun AND car and you have nothing. How far you can walk in heat wave (all water you can get is without sanitation) before you get some disease? Because there is no one to bring you clean bottled water. And if clean water is located somewhere, there is fight for it.
Civilization fell apart, it is mostly every man for himself. Heatstroke is dangerous killer even in normal circumstances. And these are not normal. People with children are most vulnerable to heat stroke - but there is hardly any help for them, everybody tries to save his own family, if s/he has any. So to escape, you have to walk far to your friends rural areas (if you are lucky enough to have any), in heat, with little water, and you have to hide before criminals who want to stole whatever you have in your backpack? How many people will make it? And of those who make it, how many are worst of criminal elements - and how many will be welcome in rural communities? Will they be willing work hard for food - or will they steal food from others?
Folks in rural areas did not liked those city dwellers anyway, and now worst of them (who made it far by stealing resources from others, less violent) want to come over and eat all the food and take over their communities? Fortunately rural folks have weapons. So small-scale civil war erupts. Such disruption make contagious diseases like cholera (caused by lack of sanitation and spoiled food) much worse. When supplies of normal trade are disrupted, many people with chronic conditions who rely on daily dose of life-saving medication will perish.
Finally, military control is established. But there is no way to feed all these people, even after 40% died from radiation, diseases, heat, crime, etc. Without steady supply of fertilizers, seed, fuel for farming machinery, productivity of farming decreases rapidly. Another source of decrease is former overspecialization. After collapse of markets, every area needs to produce all the food they need, not the one best suited for local microclimate. Cut down grapes, plow in strawberries, farm potatoes instead.
Another problem for farming is **genetically modified seeds. Some of them are sterile ** (cannot be used to grow next years crop, and you cannot buy new ones because someone ate them). Or if you are lucky seeds just do not bread true (so next generation is less productive, reverting to wild). Some seeds rely on herbicides which you cannot get. So farming slides back 200 years - but now you don't have plant varietes which farmers used 200 years ago.
So you cannot feed all population. You can either establish skill-based immigration to areas protected by military with some lottery for people without skills, if you feel generous, or make it free for all fight. Young and healthy, able to work, and with skills are desirable. Old, sick, no skills - no so much.
And yes, you will need to protect perimeters of your protected areas, but military is good at that.
Only now, when order was mostly restored, remnants of government can start figuring out what needs to be repaired, who can do it, and what is needed to repair it. Do you trust them to be smart and do right thing? Or waste time bickering and arguing about ridiculous irrelevant questions? Yes, now it looks much worse that month ago, and repairing it will take much longer. And hurricane season is just starting. Following by a freezing winter.
So coronal mass ejection by itself did not cause much damage. Damage was caused by our lack or preparation, and standard disruptions which accumulated on top of one another. Expect to lose 2/3rds of the population during the decade it will take to stabilize and rebuild.
So you have a break of a decade or two to recover and prepare for another blow: climate change. During this time, many children died because of lack of sanitation. Surviving children did not received much of schooling because they had to work to get food.
So general skills of your population is decreasing as skilled old-timers die off by age, or by accidents and simple diseases preventable and curable in previous times. So your less skilled, less educated, and less technologically advanced society is facing challenge which we don't know how to handle with our current advanced technology. As you can see, it is not going to get better any time soon. So you are forced to switch using less advanced technologies (because you don't have tools and skills to repair them if something goes wrong). Back to steam age, only now all the easy to access and mine resources are mined out.
Even if carbon output of human economies is much smaller, you use more carbon per unit of production - because carbon-based energy is all you have to feed all those people. So glaciers continue to melt, methane in permafrost continues to thaw, and climate continues to be disrupted. Southern areas, suffering less damage from sun flare, get more damage from desertification. As there is more energy in air from heat, summers get hotter and drier, winters wetter and colder, hurricanes worse, farming less predictable, famine more common. With ocean more acidic, food pyramid collapses (smallest zooplankton cannot form shell, so fish has less to eat) - only jellyfish and algae thrive.
Humans survive, but they look at the ruins of previous advanced civilization, repeating myths of survivors of the apocalypse and thinking: what went wrong? Why they did not prepared for emergencies like we do? Why they relied that someone else will help them? What they were thinking?