Yes but not quite the same scenario, but it may be worth investigating with this method.
It was after using a micro SD card in a SD card carrier with the lock switch activated in a USB card reader.
When I removed the micro SD card from the carrier and placed into a USB micro sd card reader (no carrier) it showed up as write protected.
The OS keeps records of cards/USB memory sticks, phones etc you have inserted into the USb ports of the computer and you need to remove that record (Uninstall that device) before you can remove the write protected error.
Beware, use only if you understand what the consequences of your actions may be.
I used software from Nifsoft "
USBDeview" to do that job, you need to plug in the card/USB device into your computer then check the list to find the card of interest listed.
View attachment 50937
Once identified, remove the card and then right click on the correct entry and uninstall the selected device from the list.
View attachment 50938
When that card is inserted again the OS will then re-identify the device most likely without the "write protected" error rearing it ugly head.