iPhone doesn’t ring while locked

A while back, my iPhone stopped ringing while locked. It didn’t seem to matter what settings I used, it simply would not ring. Calls were being missed, so I finally decided to look into it.

What actually seemed to fix it is weird: I went into Settings>Sounds>Ringtone and re-selected my ringtone. That plays the tone, and I guess sort of jars the phone into recognizing it again. After that, the same exact settings worked.

The settings that work are shown below: