The transport USS Jenolan crashed on a Dyson sphere, and Montgomery Scott survived by holding himself in the transporter buffer until he was rescued 75 years later.
In 2294 the transport ship USS Jenolan, carrying retired Captain Montgomery Scott as a passenger, crashed onto the surface of a vast Dyson sphere. With life support failing, Scott rigged the transporter to keep himself and Ensign Matt Franklin in a continuous diagnostic cycle, suspending their patterns in the buffer.
In 2369 the USS Enterprise-D found the wreck and recovered Scott, though Franklin's pattern had degraded beyond saving. Scott then helped Geordi La Forge use the Jenolan to keep the sphere's doors open so the Enterprise could escape.