we had same issue with orphan lock and the following workaround from Esri Support fixed it. Make sure you have a full backup before applying any change.
First (if possible), we may just need to restart SQL Server and see if the orphan locks disappear. If you want to test restarting server, you will need to right click the Instance in SSMS > Restart. Please keep in mind restarting server may affect users who are connected and editing at the time.
Please capture a full back up in SSMS. It is important to have the backup created before attempting to truncate the 'table_locks' table.
After our first compression, we can verify if the the orphan records are still appearing in the 'SDE_table_locks' table. Additionally, the' SDE_layer_locks', 'SDE_obect_locks', and SDE_state_locks' should be empty.
Next, we can attempt to truncate the 'SDE_table_locks' table. After running the query in SSMS, we can verify if the orphan locks are still appearing within the ArcGIS Administration Dialog.
Please note: verify all services are stopped (if applicable) and that no users are connected or editing before running the query.
- TRUNCATE TABLE sde.SDE_table_locks;
Afterwards, attempt to compress the geodatabase again and see if our end_state_count is now 1 within the Compress_Log table.
Reference Image: