At least the F-22 had a much better maintenance record, could stay in the air...and even now could still be the foremost Gen5 plane on the planet...
The F-35 benefitted from early gate-stumbling of the Boeing X-32 when the RFP's went out for the JSF...the X-32 had a funky unsexy profile, a difficult wing configuration...F-35 basically won by default and why there were no other players (there were I think 5 when the F-22 was selected as ATF winner) I dunno. There should have been more competition, collaboration...something.