If your vehicle is showing key won't come out of the ignition because shifter won't lock into park, here are the most likely causes and the parts you'll need to fix each one.
The small plastic bushing that connects the shift cable to the transmission or shifter lever frequently degrades and breaks. This creates slack in the linkage, meaning the shifter handle hits the end of its track before the transmission actually clicks into the Park detent.
Coins, spilled sticky drinks, or small pieces of trash can fall down into the center console and physically block the shifter mechanism from moving all the way forward into the Park position.
If the shift cable is out of adjustment, the geometry is thrown off, preventing the lever from reaching Park. This is a very common issue immediately following engine, transmission, or suspension work where the subframe or linkage was disturbed.
Many vehicles use a physical cable or electronic solenoid linking the shifter to the ignition switch. If this interlock mechanism binds, stretches, or fails, it can physically prevent the shifter from locking into Park and trap the key in the cylinder.
If the vehicle was shifted into Park while still rolling, the internal parking pawl inside the transmission can bend or break. This catastrophic damage physically blocks the transmission from engaging Park.