Good news. As I was wondering why reinstalling Opera did not resolve my problem, I realised that I did not uncheck "Delete my Opera user data." Hence, if there is a fault with the settings folder, it will remain. I also remembered that before I reinstalled my OS, I copied my two Opera Stable folders. After installing Opera,I replaced the default Opera Stable folders with my saved ones. My settings were all restored except for my previous session (there must have been something wrong with that folder).
So, I realised that if I reinstalled Opera again and let it delete my user data, then the problem would be fixed, and that is what happened. It turns out that the solution was very simple, although the initial cause will remain unknown to me.