I don't know if this is the same situation as your problem, but I also ran into GPay problems that were a bit similar. It would work for a while, but then, without doing anything on my device (i.e., just leaving it sitting in an idle state), GPay would stop working after some amount of time.Turned on the system, everything is ok.
I made an android patches, I don't use magisk modules.
Everything works well.
After a few hours, without reboots, without other manipulations, gpay broken.
One thing which I know that happens is that Google periodically checks the state of devices to see if they are "secure", by Google's standards. If not, the device is flagged on Google's web site as being insecure.
As soon as my device showed up on Google's web site as being insecure, then GPay stopped working properly.
In my case, Google decided to deem my device as insecure because after setting a PIN lock and setting up GPay, I went back to a Swipe lock. My idea was to switch back to a PIN lock whenever I decide to use GPay, and then go back to Swipe when I am done with GPay. However, after a while, Google detected that I no longer had a PIN lock, even though the device was just sitting idle in Swipe mode, and at that point, my device showed up as being insecure on Google's web site, and GPay stopped working, even when I reinstated the PIN lock before restarting GPay.
There might be other things that Google checks for which would trigger their deeming the device as insecure with regard to GPay, in addition to simply having set Swipe lock. If so, perhaps this could be the cause of your GPay problem.