I, Ebiby the Wizard, drank an unidentified potion (just for fun) and polymorphed into a Lich. Suddenly my AC jumped from 1 to -9 (I was wearing dwarven mythril armor despite its effect on my spellcasting). I took off my armor to see what it was with just the robe, which was -1. still seeming unhittable I proceeded without my armor. Eventually I went up against a Giant Ant. My spells kept missing it, so I tried to melee the ant, but it kept hitting me, which seemed odd. In the end it hit me more than I hit it and my spells didn't work, so I died after exhausting all of my potions. However, when I died, the attributes screen said my AC was 9! This explains why I was getting hit so much, but why was it different than what the status bar showed while I was alive?
Polymorphing yourself is (usually) not permanent. It will eventually revert, either because you ran out of time, or because you ran out of HP and would otherwise have died. Amulets of unchanging prevent both of these things from happening, but you don't mention wearing one.
What most likely happened is that you reverted to a human (or whatever race you were playing as), at which point your AC returned to its natural level and you died again, "for real." You may have missed the message indicating this. If you reverted on the same turn you died, then the status line would have still shown the old AC because it would not have had an opportunity to update. Giant ants have a speed of 18, while liches have a speed of merely 6, so it would get multiple attacks per turn.
Some parting advice:
- -9 AC is much better than -1 AC. Consult the wiki page for the details, but in short, when AC goes negative, that's when it starts to get significantly more effective. You want to push yourself as far down into the negatives as possible.
- You already know this, but drinking unidentified potions is an excellent way to trigger YASD.
- Liches are not actually a great candidate for polyself. Yes, they have good AC and some spells, but they have absolutely terrible movement speed and are generally on the weak side at higher levels.
- In the early game, it's often a good idea to prioritize survival over "acting like a wizard." Yes, that mythril armor was interfering with your spellcasting. No, that doesn't necessarily mean you should take it off. Early-game wizard is complicated; see the wiki for more specific information (and note that there is some disagreement over how to play it).