It can’t be a ritual he did at the last moment. The killing curse rebounded, striking fast and something he can’t have predicted. Or he must have been paranoid that something might happen and he needed to stay some kind of alive. Are there rituals about that? Never read about them.