I found that the invincible unit bug happens when you have a unit on the second row being buffed by an ear. When that unit falls to the first row, it loses the ear buff, which can cause its health to become negative, but it doesn't trigger its death, so it becomes invincible.