Instead of fiddling with the code it would be better to update your HA core to at least core-2022.5.x and up. See also your cross posts here and here.
PS.
Seems something is wrong with your installation or maybe you have a faked RM4C mini? As I said I use four of these RM4C minis since May (HA core-2022.5.x) up to HA core-2022.7.5 by today without any issues (I just added another 2 of them yesterday).
I have dug deeper for a RM4C mini and could not find that particular model as device type 0x520D. As for the RM4C mini Broadlink lists them as device type 0x62be and 0x610F only.
What is BroadlinkManager saying about the exact device type your are trying to set up?