How does invisibility work in Skyrim?

I open the first door after having gulped a invisibility potion. That is where your issue lies.

You drank your potion before opening the door, which counts as an action that ends the invisibility effect. You want to drink your invisibility potions after you open the door to sneak past the Thalmor.

Invisibility will end if the caster:

  • Activates an item (including: using levers and buttons, opening doors and containers, grabbing and stealing items).

  • Uses a magical effect other than invisibility (including spells, potions, and scrolls).

  • Interacts with a character (including attack, pickpocket, and dialogue).

Though you can't be seen while invisible, you can still be detected if you make too much noise or do anything that would attract attention.

Although you cannot be seen when you are invisible, you can still be heard, meaning enemies may still detect you. You are more likely to be detected if you:

  • move too close to an enemy.

  • swing a weapon (even if you don't hit someone with it).

  • run into a mobile object or walk on a trap.

  • make noise, including casting the spell without using the Quiet Casting perk.

If you want to get your best experience of invisibility, you can use it in conjunction with Muffle (an apprentice level illusion spell and armor enchantment)

Because the Dragonborn's footfall can be heard by enemies while invisible, Muffle is useful when combined with it. Using both spells while sneaking makes the Dragonborn almost impossible to detect by others, unless the Dragonborn bumps into them or performs an action