Samsung phone charges poorly, periodically
The phone probably had malware introduced through a SIM-card.

The phone also stopped recognizing the SIM-card. No calls or data possible. It asked me to make a factory reset to "accept new network configuration". Charged poorly when not turned off.

I removed the SIM, made backups and factory reset (which needs wifi to find my Samsung account password to allow for reset).

I do not wish to point out any country in particular. This has happened before in other countries. The new SIM that only worked for two days, I had bought in a big shopping center that also gave away SIMs for free with other buys. Largest network in the country I believe.

I had also connected to a hotel wifi with advertisments etc.

I went to the only direct outlet for the network and asked. They told me the SIM had given me the problems. Hotel networks have ads but are safe.

Malware was running, draining power and also interfered with connection.

The network shop was super pro. They sold me a new SIM and "pocket wifi" and set up everything perfectly. All works fine now.

My conclusion:
Only buy SIM directly from the network shops (or if you trust their envelope seals). (A lot of hassle for me that often travel and roaming  becomes too expensive. But no other choice.)

Data I backed up but apps seem to have problems downloading through the Google/Samsung system. Hopefully it will improve when wifi is not crowded in the night. But I can restore apps manually. The app data seem to be there if I just download the app manually. The nice Adobe Lightrooom that I reinstalled suddenly has pay-options for what used to be free :(  ;)

What the malware programmer wishes to achieve is not clear.