Short Time
(1990)

Burt Simpson (Dabney Coleman) isn't really dying, there was a mix up with a bus driver.

In a final encounter with cop killer Carl Stark on board a window-washing platform, Carl loses his grip on Burt who appears to fall to his death only to survive due to accidentally entangling his foot in some rope.

He attends the bus driver's funeral (who subsequently perishes in a traffic accident due to his illness) and retires.

 Thanks N.D. Woods!