Oh dear, sorry I've only just seen this. If you or anyone else needs to know:
I have a YSort node, with two children: The TileMap with all the objects like the boxes, and the Player. I don't think I did anything special to the tilemap or the tiles themselves... make sure that in your TileMap node, you set the Tile Origin correctly to either center or bottom. I haven't looked at this project or Godot in a while!
Viewing post in Tobias in the Attic (Godot practice) comments
All children of a YSort node will be displayed in a particular order, based on their y positions. Child nodes with a higher y position will appear on top of nodes with a lower y position. So rather than using Godot's default "Z index", or level hierarchy to determine what goes on top of something else, it's using the y position of each object - things lower on the screen will be in front!
So when the player's origin point is below the box's origin point, that means the player should appear in front of the boxes. Once you move the player up so that their origin point is above the boxes' origin point, the boxes will be drawn on top instead.
Note that for this type of game, each object's origin point should be set to "bottom", at the point where they "touch the ground". Having it set in the middle of the object can lead to weird results.