Quick answer: GameMaker instance_create_layer placing the new instance behind expected siblings? Layer depth is layer-based, not instance-based - use depth = -y for per-y-sorting within the layer.
Spawned a pickup on the entity layer; it draws under the floor decals. Both are on the same layer - sort is broken.
Y-sort within a layer
depth = -y;Set in Create or Step on every entity that should y-sort. Lower depth draws on top.
Or use a sorted ds_priority
For exact control, override the layer's draw via Draw Begin event. Iterate a sorted ds_priority and call draw_self on each. Costs a sort per frame but draw order is yours.
Avoid mixing managed and manual
If even one entity on the layer uses depth, the layer's normal sort breaks for everyone. Pick one strategy per layer.
“Depth-sorting in GM is per-layer, per-entity, or both - never half of one.”
Keep a single y-sort macro/script. Reading depth = -y in twenty places is fine; finding the twentieth one when you change strategy is not.