Tile map doesn't layer correctly with other nodes

Godot Version

godot-4.2.1

Question

First of all, thank you for checking out my problem.
I’m trying to use a Tile Map for a 2D game but the layering doesn’t work properly with nodes that aren’t part of the Tile Map.
I want to have a layer of the Tile Map that will be be displayed behind or in from of the player depending on where the player stands.
From what it seems to me when the node reaches the middle of the tile it goes behind it but not the entire layer either as it will still be above the next tile above it.
I am using Y Sort for all of this.

If anyone has any suggestions or fixes please let me know.
Thanks in advance.

My problem is with things like the player or other nodes outside of the Tile Map. The Tile Map layers work fine for me so far but I need to allow for dynamic parts in the game to be able to be displayed in font or behind certain layers of the tile map depending on the situation.
For instance, if I want the player(not part of the Tile Map) to go behind a tree(part of the Tile Map) I need the tree to be displayed above the player when the player goes passed it but not when the player hasn’t.

Interesting. I’ll give it a try.
Thank you

If I understand, doesn’t using this method means every layer will need to only contain a single object since changing the z_index of a layer will change everything within that layer?
There has to be a better solution

I don’t thinn you need to change it for every object, just for the ones that do not eitk properly after starting to use the layers.
Hope this works