Objects Unintentionally Rendering Behind Others

I’m moderately new to Unity 2d, and I’ve encountered what appears to be a bug. Whenever my “enemy” sprite gets too far from my camera, it renders behind the background. My camera is set to perspective, but if I switch it to Orthographic another issue occurs, where one animation state for my player renders behind the background as well. Is there any way to fix either of these bugs?

I found a temporary fix for this issue, but I still don’t know what causes it. I simply pushed the background back along the z axis. I’m not sure why this worked, but it did.