What happens when a charmed target becomes unable to be charmed?

So a bard charms monster 1. Monster 2 uses an action ability (such as Infernal Command) where it can make it so monster 1 can’t be charmed.

Does Monster 1 lose the original charmed status or does it keep the original charm?

Does Infernal Command, for example, only prevent the target from being charmed again by something else while the ability time is active? My line of thinking is like putting on a bullet-proof vest after you have already been shot.