After this happened to me, this seems to be a somewhat common problem relatively speaking. I had this issue initially where it wouldn't recognize any fob and was stuck in the program loop. I could start with app, but couldn't drive. It ended up working after a couple of hours while a tow truck was on the way. It turned in to a truck battery issue.
Some have replaced their truck battery and all was well. Some have a battery drain by itself, or in conjunction the key fob issue. There is a service bulletin about unexplained key fob issues with no apparent root cause found. It discusses replacing the drivers window switch/control, the door latch assembly, or both. Some have replaced the window switch alone and it has gone away. I replaced the window switch since it's cheap and easy to do.
On the door switch, the theory is that a bad switch send the key lock/unlock signal over and over and puts it in program mode. Some also attribute this to the battery drain since the system turns on over and over. Some have said that holding the start button for 15 seconds will take it out of the mode and let you start. When it happened to me a few times, I just disconnected the negative battery post and all was well until it happened again. I carried around a 10mm socket.
Also if you have something in the OBD2 port, like retractable steps, start stop disable, etc., there are reports of this causing issues.
Lastly, which I think was cause of my issue, is the rear glass leaking. There is a technical service bulletin about that too. I had noticed that the battery drain happened when it rained. I started digging around and my headliner was wet. I found the leak and there are numerous electrical connections below that could have gotten moisture or wet and cause drain, which in turn could cause the key fob issues. The frame for the rear glass is plastic and cracks. There are two ways to fix, fill full of silicone or body sealant, or replace the back glass. This is a known problem.
I'm hoping this fixed my issue and my battery was drained to like 5v several times, so I think my new battery may be toast. It was low again the other day, but haven't had the key fob issue again. By the way, the dealer had it for 5 days, couldn't find an issue, and several days later of course the battery drained.