The "While locked" or "When device is locked" menu is missing in settings
Go to Security settings and select "screen lock". Create a lock (even if you have one already). After confirming the lock, you will be asked to change how your lock screen notifications are displayed. Change according to your liking.