I think treason is not covered by PI.Did not Trump accuse bamy of treason?
The nature of the accusation does not determine whether or not immunity applies. You look at the action the President took, and leave aside all questions of intent or motive. So in the case of Obama, the question likely would boil down to something like this:
"If a President tells his subordinates to prepare an intelligence assessment regarding whether an American politician is acting on behalf of, or being influence/assisted by, a foreign government, is that an act within the scope of his official duties as President?"
If you look at that question just as stated, the answer has to be "yes". Saying "well, he knew it was false and was trying to do it anyway to overturn an election" doesn't change the nature of the act as being one within the official duties of the President.
The entire point of immunity is that you never get to questions of motive, truth, self-interest, or merit. Those are going to be subjective determinations that would enable the criminalization of almost anything the President does.
It doesn't mean that what Obama did was right, or good, or justified. It just means he wasn't acting outside the scope of his duties as President.