Trump claimed repeatedly and vigorously that whatever the President does is by definition legal. He also repeatedly and vigorously claimed that Obama had broken the law by spying on then-candidate Trump in 2016. I don't know if he himself noticed the contradiction but blustered on anwway or was too dense to notice.
[BTW, Trump wasn't spied on -- Russian assets were spied on and it turned out that some of those communications were with Trump's team. There are ~100 pages of these communications captured in the Mueller report. ]
Talking out of both sides of his mouth is kind of a daily thing at this point. But he's had a lawyer advocate the immunity point before the Supreme Court while he hasn't attempted to prosecute Obama.