It should be noted that this happens only when there are 2 or more entities of that type. This happened to me in a bedrock block of 31x31 blocks filled with air inside. Well, when I generated 1 entity, everything normal, but when I generated the second one, it started I miss it: Entities started to break through the bedrock
Duplicate of MC-5364. The ender dragon is intentionally designed to fly through blocks.