My WLAN always goes out on my Samsung Note 8 (Android 9 Pie). If I then disconnect the Wi-Fi and connect it again. For other devices (notebook, Smart TV) there's no problem. Speedtest on the phone gives an average of 50 Mbit. Youtube videos look at least 5 times to reconnect the WLAN is not possible.
Did you make an update?
Have the phone only for two weeks. One day after the purchase came the Android Update (from 8 to 9).
My idea would be a new operating system but with Samsung I do not think so.
Then you have to ask where you bought it
An idea:
Take a look at the option "Wi-Fi +" or "WLAN +", that's such a frills, which can switch your WLAN on / off according to your GPS position to save energy. How and where is set in Android 9, I can't say… Somewhere under wireless settings.
Possibly. Is there somewhere a power saving feature for Wi-Fi. Some antivirus protection programs can also have such energy-saving feature.