This behavior was introduced in 1.17-pre1.
The bug
If an ender dragon is summoned with the DragonDeathTime tag set to 200 or greater, it infinitely drops experience orbs and never disappears. The only way to remove this ender dragon from a world to prevent it from creating lag is to edit the world data.
Steps to reproduce
Run the following command:
summon ender_dragon ~ ~ ~ {DragonDeathTime: 200, Health: 0.0f}
Can confirm. I reproduced this and it just infinitely floats upward.