My understanding is that you have immunity while president but are open to penalty once out of office.
This last year has shaken my feeling of stability in our Supreme Court, though. I wouldn't put money on this outcome. I feel like it is a slam dunk, but I would think that a ruling against immunity might be the death knell for MAGA, and for sure Clarence rough ridin' Thomas knows that. Unfortunately, a ruling for immunity will probably have the same effect but on America instead of MAGA.