Reagan said that but he knew damned well that the President normally gets the credit (or the blame) for everything his administration does. When he was running for President he didn't say it didn't matter who did good things when he was Governor.
Trump gets blamed for everything and credit for nothing, when he was president and still today. Had Youngkin lost everyone everywhere would have said it was because of Trump. I can't fault him for taking a victory lap when he helps swing an election. And he did help.
Trump’s policies and how they benefited the lives of ordinary Americans are showing up ever more powerfully in stark contrast to the Dem’s failing policies. Youngkin ran on MAGA policies and won.