So I was messing with my 2004 CTS 3.6L. One thing I tried was opening the door while the key was still in the ignition the car was of course parked and turned off. Then after I tried to lock the door, the car made a beep. After that, I got out and locked the car and everything worked fine. However when I tried to later open it it would not work.
So I unlocked the car with just using my key without using the key fob remote. Then I repeated the same processs and my key fob remote worked again perfectly.
So if anyone could explain to me what I did, or if this can help anyone reprogram their keys, it woudl be a great thing.