Mk Gonda,
You're not using it properly. It's confusing, and I ran into the same confusion. Here's what to do:
Settings>Notifications>Do Not Disturb
Turn Scheduled ON and set the From: and To: times.
Here is the key - in Settings, do NOT turn Do Not Disturb ON. When you set Scheduled times, the phone will turn this switch ON and OFF automatically based on the From and To times and the current time. If you turn it ON manually you are overriding the Scheduled times.
So, set up the schedule and don't touch the ON/OFF switch. You will see that during the From and To range times, iPhone will turn DND ON and outside of that range it will turn it OFF. You don't need to touch the switch when you are using a schedule.
So, in summary - don't touch Settings>Do Not Disturb unless you want to override the scheduling or if you want to control it manually and not use scheduling.
Also, please note well - DND only is in effect when the phone is locked and the screen is off (ie. it's sleeping). If the phone is not asleep, alerts and phone calls, etc. will come thru even if DND is ON. So, if you are running a travel clock app while you're sleeping or checking mail in a library, know that all alerts and phone calls will come thru and sound thru the speaker. This is not a bug; Apple assumes if the phone is not asleep that you do want to be disturbed.
Finally, also note well - set alarms (Clock>Alarm) will ALWAYS sound no matter if DND is ON, Silent switch is turned on, Airplane Mode is ON, etc. The only way to silence alarms is to turn them OFF, or turn the phone off.
Hope this helps.