The rules for a Vorpal Sword include
When you attack a creature that has at least one head with this weapon and roll a 20 on the attack roll, you cut off one of the creature’s heads. The creature dies if it can’t survive without the lost head. A creature is immune to this effect if it is immune to slashing damage, doesn’t have or need a head, has legendary actions, or the DM decides that the creature is too big for its head to be cut off with this weapon. Such a creature instead takes an extra 6d8 slashing damage from the hit.
The rules for Armor of Invulnerability includes an effect to render the wearer immune to nonmagical slashing damage:
...you can use an action to make yourself immune to nonmagical damage for 10 minutes...
The rule for the Vorpal Sword's decapitation effect does not specify immunity must be to magical slashing damage, But the rule for Armor of Invulnerability does specify immunity to nonmagical damage. So does this mean that a creature wearing Armor of Invulnerability is immune to the decapitation effect of a Vorpal Sword, but does take the extra 6d8 slashing during those 10 minutes?