try clear data
settings → apps → tap hamburger icon → show system apps → USBSettings app → clear data
then kindly turn off and on the device
@EmmaLouiseH: I'm sorry to hear that you're experiencing this issue. Do you have access to another charger that you can try to see if the issue persists? If not, try swiping up from your Home Screen to access your apps > Samsung (folder) > Samsung Members > Get Help > Interactive Checks > Charger/USB, and follow the on screen instructions. If any errors are flagged here, please reach out to our Help Desk on 0333 000 0333, or via Facebook or Twitter, and an advisor will be able to look at your available warranty options.
This has to be a Samsung software/hardware bug with the usb charger of many phone models. I started to have the same invalid Moisture detected error on my S21 ultra. It is very shameful that Samsung does not give a solution to this. I am convinced it is a software bug because my problem was random until yesterday. After the latest software update installed yesterday the problem is permanent now.