I'm getting the same thing all of a sudden. Had you done the latest software update by chance? Or anything else different/new on your phone? Have you figured out the issue?
Are you using the same outlet when you get this error message?
I've gotten this message before on my S8. It turned out to be my other manufacturer charging block and/or cable. When I purchased one from Samsung, it didn't happen anymore. Note, I also had it happen when one of my Samsung bricks went bad. My husband is electronics savvy and he tested it and found it to have gone bad. I don't know what I did to it to do this, or maybe it was just faulty in the beginning. So, what I'm saying is that it could also be happening even with a Samsung device. I hope this helps.
Yes I have had this issue happen to me several times through the months and every time it's happened I have always found out that it was either the charging cord, or the charging box. They were never a brand of Samsung. These were the kinds you buy at the local gas station of Dollar Store, sometimes Walmart if you decide to be cheap.
This is caused if you have several intensive apps open to where you are draining more power than you are charging. Be sure to close all apps and run a diagnostics in device maintenance