For further debugging, you could also precede a swap test. Have you tried another wifi or use another phone to test wifi condition.
And you could also check one setting. Settings/ Wi-Fi, and then choose three dots, Advanced/ Keep Wi-Fi on during sleep.
Look forward to your response. Thanks.