Quick answer: Godot 4 multi-layer TileMap rendering in wrong order despite z-index differences? TileMap layers' Y-sort enabled mixed with non-y-sorted layers - normalize y_sort_enabled per layer.
Layer 0 (ground) and Layer 2 (decorations) both have y-sort. Layer 1 (walls) doesn't. Wall sprites appear above player despite being lower.
Normalize y_sort
Either enable y-sort on all layers or disable it on all. Mixed configurations sort in unpredictable order because each layer applies its own rules.
Use z_index + y_sort together
Z-index sorts between layers; y_sort sorts within a layer. Use both to get 'walls render after ground but characters render within walls'.
Verify with the debug view
Enable Visible Collision Shapes. Sort issues often correlate with collision shape ordering; the visualization helps spot them.
“TileMap layers compose. Sort settings must compose consistently.”
For complex isometric games, write a small TileMap inspector tool that shows per-layer sort settings. Drift across layers becomes obvious.