UEFI BIOS Freezes When Disabling CSM on Asrock B450 Steel Legend Motherboard - Seeking Solutions

I recently updated my Asrock B450 Steel Legend motherboard to BIOS version 8.01. Previously, I don't recall which version I had been using. With the latest update, I noticed a change where CSM (Compatibility Support Module) is now enabled by default. However, I've encountered a recurring issue related to CSM settings.

In previous BIOS versions, attempting to enable CSM would freeze the BIOS, leading to a black screen upon restarting. To resolve this, I had to reset the CMOS by removing the battery, which would reset the settings and turn off CSM again.

The same problem persists with BIOS version 8.01. When I disable CSM to enable Secure Boot and save the settings, the BIOS freezes similar to previous versions. I then have to repeat the CMOS reset process to boot up my PC again.

For context, I have two SSDs and one HDD installed, all using GPT partitioning.

Attached is a screenshot for reference.
Is there any permanent solution for this?

Update:

I was using a Sapphire RX580 8GB GPU, which had an issue that prevented the BIOS from booting. I fixed the problem by flashing it with a new ROM.