A Rakshasa has the following trait:
Limited Magic Immunity. 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.
An answer given by Legendary Dude in this question says that Animate Objects can affect it (although as correctly pointed out by NautArch, it's a moot point as it also has immunity to nonmagical weapon damage anyway). The gist of this answer is, Animate Objects does not directly affect it but instead gives life to objects, which then target it.
As a follow up to the linked question, can spells like Maximilian's Earthen Grasp or Bigby's Hand affect the Rakshasa? Both of these spells create things which targets other things (in these specific cases, hands which can target creatures). This is similar to Animate Objects in that sense.
As a clarification, by "affect" I mean the normal stated effects of those spells. MEG forces a Strength save or be restrained and take damage due to the summoned hand crushing the target. BH does an attack, push, or grapple due to the summoned hand attacking, pushing, or grappling the target.