The lich is supposed to be invulnerable when he is in his teleport animation, and he sometimes teleports in place to juke your attacks (completely RNG)
Was he invulnerable when he wasn't teleporting? It might have bugged out in that case
Glad you enjoyed it though and thanks for playing!