Question [Q] Will changing device firmware remove SIM hardlock?

Hello!

I bought a Sony Xperia SP from eBay and the seller said it was unlocked. Turns out, however, that it is locked to Orange UK.
Without knowing this, I accidentally managed to get it hard locked. There are no repair shops locally that can unlock it.

I have been trying to sell it on eBay again but to no luck, so I am ready to start looking for other options.

I have searched for this and found that changing the firmware will not re-lock an already unlocked phone, but what about the other way around?
If I change the device's firmware to an unbranded one, will that unlock it so I can use any SIM?

Or are there any other options besides just throwing it away?

Thanks!