Y: Antimatter generation and storage. A combination of solar arrays and thorium reactors on the moon are used to gradually produce antimatter intended to fuel the first interstellar vehicle.
https://upload.wikimedia.org/wikipedia/commons/9/93/Lunar_Thorium_concentrations.jpg
There are several moon bases for the extraction of thorium (at the highest concentration areas - see the Wikipedia map) which is then piped to the reactors. The reactors then power a particle collider to produce the antimatter which is sent via magnetic containment tubes to a storage facility.
Because of the heavier solar radiation (no atmosphere for protection), the moon bases have hardened electronics (which protects against the solar flare). When the solar flare hits, the moon bases are mostly okay except for the storage facility which has a crucial failure in an older circuit – inattentive maintenance allowed it to remain in place for too long.
Alternately have the storage facility in the sunlight while the other facilities are in shadow during the solar flare.
Z: Not half the population unless the deaths happen over decades. Too many bodies too quickly becomes a hazard in itself.
A solar flare will knock out the electronics for only half the planet but two happening roughly twelve hours apart during the summer (so the northern hemisphere is more directly facing the sun) should take out the electronics except in the most southern portions of the world.
However exactly two solar flares at twelve hours apart would seem a bit contrived. Instead a series of flares occur from a massive sunspot: a large one then two hours later a 'small' one then another five hours later another 'small' one with predictions of that being the last. But a final large one occurs another eight hours later (total of fifteen hours after the first). This would cover pretty much everything if the first takes out the USA and the last wipes out Russia and Europe. Japan and China get the smaller ones which do wipe out a lot of the electronics but not everything.
Obviously you would adjust the timing and locations to suit your story.
With the large solar flares causing widespread electronics failures, the containment of various biohazards is compromised. The best facilities remain sealed. But in your future world, there could be a boiwarfare race happening with plenty of poorly prepared facilities. Those release all sorts of boiweapons which cause disease and sterility in many areas of the world even after air travel is shut down (due to the solar flares).
Some of the bioweapons could be vectors intended to augment soldiers giving you various regional human variants.
With much of the lunar bases automated, for a time the thorium continues to be processed, fed into the reactors and the antimatter fed out …
At the other end the antimatter is propelled out and gradually falls to the surface of the moon where it interacts with various minerals producing a variety of radioactive bursts at regular intervals.
Eventually the thorium production fails so antimatter production falls. But the solar arrays could allow a much reduced antimatter production.
The regular radiation bursts fuel an adaptive trait which some of the bioweapons activated in the infected people – or their offspring – giving you the people with abilities you wanted which activate only some of the time.
Um, 20% of the moon is a huge amount of material. If that falls on the Earth then everything except maybe bacteria dies. Or maybe all the bacteria die too. Even if (for example) the south pole of the moon is cut off and thrust away so it misses the Earth and just keeps going, the other 80% of the moon will be driven the other way at one fourth of that velocity.
I thought of something that sort of works but don't know how it could really happen: a chunk of the moon is sliced off and given just a little sideways propulsion which effectively just sends the chunk sliding around on the surface to rest in a different place. This changes the look of the moon but not its mass. Changing the mass of the moon would cause many problems for the Earth and humanity.
Hope these ideas help.