Gengar can be challenging
The raid boss was expiring, so one attempt. EX eligible gym. Cloudy vs Focus Blast. Dodged a few of them, finished with 2 seconds remaining. Worst must have been C/FS Alakazam, don't even remember it. Other than adding an Espeon instead of Alakazam and not getting some more charge attacks off, where might I have improved my time without fainting? ***Mewtwos have PC, but might just change the smaller one back to C

Answers
On the bright side, first time maxing some things made a win or lose difference. Especially bc I wouldn’t have had another attempt. Lugia kept me afloat, too, even tho it is SA instead of FS—one of the few recent times Lugia has been useful***However, looking at Pokebattler, no clue why I didn’t easily win—probably just extraordinary bad luck that it took so long/almost fainted
I have another level 30 12a Mewtwo with C/Shadowball, I would use that before that Alakazam or an Espeon.
I had to run to the gym, so didn’t think about it much. Phone wasn’t being responsive to consistently dodge, but looks like I dodged just enough without dodging too much...one more mistake and woulda been times up + faint
Dragonite is right out - generalists aren't usually great in Solo attempts. You need to hit hard, hit fast, and not worry about fainting for most of the Solo raid. Lugia... probably out too; it doesn't do enough damage for most Solo attempts. It's a nice break, though, so maybe. Would have to be double-psychic, tho.
Given that it had Focus Blast, I would have put in 3+ Ghost/Ghost Gengars as well as and Psychic Esperons, Eggecutors or even Gardevoirs (I don't have Psychic Gardevoirs, but it's a good option). I might consider tossing in a double-Ground Groudon as it can do Super Effective damage and only take Normal damage from Focus Blast.
But mostly I'd be adding in other Gengars with Ghost movesets. Lots of damage done, not much damage taken, can really get out ahead of the clock with them.
The auto pick had two Lugias, Alakazam, Gengar, Espeon, plus something else. That scared me enough to anchor with Dragonite and the better Lugia. My DPS attackers just didn’t land anything—the SC Gengar was fine but the other 3 must have missed everything. I beat regular Gengar with 50 to 60 sec each time usually with 3670 and 3478 B/C Tyranitars and the shadowball Mewtwos—I also was scared that rejoining after fainting would lead with my level 32 Lugia—however, obviously not scared enough to effectively dodge with my party’s Mewtwos and Alakazam
I find it hard to believe that you struggled that much against Gengar. I have a worse team (no Mewtwo, for one) and win with 30+ seconds remaining.
Honestly, your team is ridiculously good. Your Dragonite looks like it's maxed out at level 40. As long as it has DT + O, it's perfectly viable in a Gengar solo. Don't let anyone else tell you otherwise.
I simulated your team vs. H + FB Gengar in cloudy weather with no dodging, using GoBattleSim. Your team has a 100% win rate with an average clear time around 130 seconds.
I agree, Gengar Sc/ShB 13a 82% level 40. Mewtwo PC/ShB 15/11/15 level 40. Mewtwo PC/ShB 13a level 30. Wild caught (slight boost) Alakazam C/FS. Dragonite level 40 96% DT/O. Lugia EX/SA 96% level 34ish. A combination of complacency since my team is strong, raiding while I’m rushing to work, and I don’t even remember the Alakazam ever happening.
Given your team it was definitely lag or network error. When I was visiting Canada the international data rates were extremely poor. My team that usually wins vs Machamp with 40s left cleared with only 5 because the boss stopped attacking for ~25s and when he resumed the guy I was using and the next one was dead (it also regenerated health).
Also Focus Blast is notorious for being terribly laggy and I often have more than 1 Pokémon killed with a single lagged FB. One time I was trying to solo a C/FB Boosted Zam. I had a Ttar with ~50% health left it died, then the next Ttar appeared and immediately fainted, I want to say the last Ttar had a chunk of health taken out too, but the recording stopped likelyout of pure frustration.
https://youtu.be/UpneWi6MPOo
Last time I solo'ed one I used:
-Mewtwo PC/SB
-Tyranitar B/CR
-Tyranitar B/SE
-Houndoom S/FP
-Gengar SC/SB
-Lugia ES/FS
I don't remember their exact levels but all were at least 30. Gengar knew Sludge Bomb which sucks to dodge, I think only one dodge was successful. Sludge Bomb destroyed my Houndoom, I'll probably replace it with something else next time. All in all I finished with just slightly under 30 seconds left and never even got to Lugia.
If you have a Tyranitar with either of the movesets mine have I'd use it regardless of Gengar's charge move. It resists every single other attack Gengar can throw at it and Focus Blast is very easy to dodge, it's almost not even a threat. Drop your Dragonite for one and your Alakazam if it's proven to be ineffective. Confusion on the Mewtwo isn't a bad idea damage wise, I find I can't dodge for crap with it though.
Happy end to an almost sad story...did another boosted Gengar, had sludge...Used 3 Mewtwos, the Gengar, max Dragonite and a 3680 ground Groudon, won with 52 seconds left. Also, I did get the EX pass for 4/22 bc of the boosted FB I barely beat (I raided at same gym a few other times that week, too, so would have got it anyway)