If your system gets locked (I.e. ransomware) and you have secure boot active, then you are out of luck.
See Apple M chips which if they get locked you will never unlock them again.