I have a Note 9 and I started to get this notification when I plugged in my thermal camera. The carging cable was working fine, but the thermal camera was generating the connected / disconnected issue.
My fix: turned off the phone, sprayed a bit of electronic contact cleaner into the port, and then using a slim toothpick wrapped in paper towel I cleaned the port. After that I blow dried the remaining liquid (it evaporates very fast). Turned on the phone and I tried the thermal camera and it works perfectly.
Today this started happening to me too. I have Samsung Galaxy A60 which I bought few months ago. I tried factory reset and cleaning the port but it doesn't help. I'm thinking about taking it to the service tomorrow. If someone knows how to fix this without taking it there please answer.
I have the same problem in A50 phone; quite disappointed with Samsung. I have tried several things , not dismounted to clean the connection point...The only thing taht works for me is to switch off and restart the phonein 20-30 seconds. The notification disappears and you can block the phone and turn the display black; otherwise the battery goes off.
My A50 has this problem and I solved this issue by Software update, it is in Settings-> Software Update. My old version have the problem is April.2019. After update it is April.2020. The problem immediately gone.