This happened to me a couple of weeks back. With the remote battery being 17 years old, I changed it, which seemed successful, for a few days.
I then found to be intermittent, working fine everywhere, except back at home.
Someone suggested it may be parked close to a 'smart home', as apparently some of the smart stuff uses frequencies close to the fob frequency. I moved the car one car length up the road, no problems since.
The fob transmits a new code each time, using an algorhythm. The car receiver sits waiting for any of the next 3-5 signals. If it does not receive a signal, such as out of range, or if the buttons have been pressed when away from the car, the fob will transmit a code further along the list. Usually pressing the button 3-4 times will allow the car to recognise the sequence as its own, and reset. Worth a try.
The car's receiver is not a known issue, so worth exploring external issues first. A vehicle locksmith should be able to check the fob is transmitting.