Welcome to Android Central forums. This is truly odd behavior and to me it sounds like it could be a bad app affecting other apps. Just a few questions first.
In your example you show this happening with photo apps, does it also happen with browsers or any other type apps? If it is only photo apps it might help us narrow down something about this where if it is everything that could mean something else.
Do you have any selections that are working? In the past have you been able to set up a default choice and have it still work today?
If you had a default selection in the past, and take away its default status, are you then blocked from re-adding it? I suspect you would be if this is across the board. To remove default status from an app, Settings>Applications>the app>Set as default reset this to remove this app from the default selection of other apps as the app to use for (whatever).
How long has it been that you've noticed this? If it happen to happen after an update it may be a cache issue. To do this, power the phone down, press and hold both the power button and the volume up (+) button, when the Realme splash screen appears release the power button only, when the phone has fully booted release the volume button. Use the volume buttons to navigate and the power button to make selections. Select Wipe Partition Cache allow the process to complete and then use the Reboot option and allow the phone to restart.
One of the tests we use to determine if a behavior is being caused by the device or OS is to run the phone in Safe Mode and observer the behavior. Safe mode takes away the ability for apps to run in the background and to affect one another, which is why if something happens in safe mode it is usually the device or a system app. If it doesn't then we assume it happens due to other things, like bad apps. I'm not sure that we'll be able to test this in safe mode due to the app interaction aspect, but please try to perform one of these tasks while the phone is in safe mode. To enter safe mode press and hold the power button until the power options appear, press and hold Power Off until the option for safe mode appears, and then select it to have the phone reboot in Safe Mode. Some of your apps may not work since Safe Mode disables some processes, try to find one that works, if you can test if you have the Always option. If you do you can also check if it works. It may not since app interaction is also affected by SM.
So, what if it is a bad app? You'll need to first identify that app and take some kind of action. It could be taking away permissions but it could also be uninstalling the app.
Do you have any apps that you didn't get from the Play Store, Amazon App Store or the Realme Store? This would be any app you got online or through an ad that didn't take you to the Play Store to download and install.
Are you using any "saver" or "anti" apps? Memory Saver, Data Saver, antimalware, antivirus? Disable them for testing as these apps usually have more permissions than other apps and while touted to be helpful can often have negative effects.
Give us answers and let us know what you find for more advice.