Limited Magic Immunity says
The rakshasa is immune to spells of 6th level or lower unless it wishes to be affected. It has advantage on saving throws against all other spells and magical effects.
Does this take the base level of the spell or the level of the spell on casting?
Take note of this text from the Player's Handbook:
When a spellcaster casts a spell using a slot that is of a higher level than the spell, the spell assumes the higher level for that casting.
Best Answer
Upcasting does indeed bypass limited magic immunity
The general rule is that a spell cast using a higher level spell slot is actually that level spell for that casting for all relevant effects. There is no base level and upcast level. A spell is the level it is cast at.
There is no indication in limited magic immunity that the ability is meant to block spells cast with a higher spell slot. Allowing it do do so would be granting it an ability that it does not have as written.
Compare that to the Globe of Invulnerability which says:
This item has a specific rule that overrides the general rule about spells cast with higher level slots. The rakshasa's ability does not.
Jeremy Crawford has answered a similar question about the wizard evocation ability overchannel and come to the same conclusion:
Since overchannel only works on up to 5th level spells, a 7th level fireball does not qualify since it is actually a 7th level spell when it is cast.