You could have a parking pawl issue. This is internal to the transmission so a professional inspection is needed. If you don't work on your own car then use this link to find a good shop near you.
https://repairpal.com/repair-shops
Alex
RepairPal Certified shops can diagnose and repair your 2002 GMC Yukon XL 1500. They provide transparent pricing with a minimum 12-month or 12,000-mile warranty on repairs and services.