The bug
If the exit portal is removed and the ender dragon tries to perch, it will fly to y=0. Doesn't matter if it's a hole or not, it will go through blocks tho.
How to reproduce
Enter the end.
/execute in minecraft:the_end run tp @s 0 100 0
Remove the exit portal (make sure the enderdragon is alive).
Stand on top of the exit portal and run: /fill ~-10 ~ ~10 ~10 ~-60 ~-10 air
→ ❌ The ender dragon flies to y=0, if it wants to perch.
Code analysis
Code analysis by @unknown can be found in this comment.
Linked issues
relates to 2
Attachments
Comments 32
You can't break bedrock in survival, the dragon fight is geared towards survival.
It is still a glitch. While the fight is meant for survival, this still happens and should be fixed
Alright, reopened for Mojang to look at.

There is a ticket where the ender dragon flies high up when the exit portal is extended on top, but cannot find it.
Affects 22w13a

Relates to MC-201937, is a remnant of the ender dragon AI being broken in 19w08b effecting its decending behavior and its dragon phases.

@unknown This issue predates 19w08b, so it is very unlikely that they are related.
Can confirm in 1.19.
Hi, I reported this issue about 7 years ago when I was 10. You can see my account at the bottom of the history. I get emails every time it's updated! I don't even play minecraft anymore. Just wanted to say good job to all of the contributors that work on this game STILL to this day. Its amazing.
The blue shield is a glitch it did not get removed from my inventory
i am in the affected version
just in case you dont know