Resistence 5 makes mobs immortal
This is a bug that has been in the game for a long time (approximately since version 1.13.0-beta 4). It is a bug in which a mob becomes immortal when it receives resistance level 5 and higher through the / effect command. The only ways to kill this mob are: or using the / kill command on it; either waiting for the resistance effect to end or using a command to remove it and then kill it.