Try using do not disturb, that usually helps by going to Settings > Sounds and notifications and check that the following are selected to how you want. There are two options:
Volume: To adjust the volume level for music and videos, system sounds, call ringtones, and notifications.
Do not disturb: Mute incoming call and notification sounds, except for allowed exceptions.
For the Do not Disturb option, check that you are not leaving an exception for incoming calls before enabling because that could be one of the problems too.
Also, as a last resort like you said, you can also flash your phone using this well-explained guide by clicking the link here (don't mind the title, the process of flashing can either upgrade(which you don't want) or downgrade(which, of course, you want) ) which will provide all the resources you need to properly flash your phone.
REMEMBER: I am not responsible if you brick your phone if you follow these instructions incorrectly. MAKE SURE you select your correct device along with the correct ROM you want to use on the SamMobile website, meaning, since you want to downgrade, select a firmware other than the 9.0 Pie firmware, so an older one like one back in 2017. If you don't know how to use Odin, follow this link which will provide you with instructions of how to use it.
ALSO NOTE: To avoid the stress of you permanently bricking your phone, install a custom recovery like TWRP, which will make life easier when you have to deal with a bricked phone.
I hope these instructions were helpful and wish you the best of luck.
Cheers,
Joe