My bug report that duplicates this has a data pack example attached
Yeah this is pretty annoying, I think worse is that command blocks have the same problem so if you have a long command and want to replace part of it and forget to press backspace first, it's harder to get back to where the error is because you can't see the whole command at once.
I found it easier to reproduce over the void in the end, it works for most mobs
If you just remove minecraft: from the name it'll still work
This is visible only in spectator mode because otherwise there would be fog hiding the z-fighting textures, I believe.