Contrary to occasional dramatization, Johann Sebastian Bach did not attempt to escape Duke Wilhelm Ernst's authority. He served as court organist and later Konzertmeister in Weimar (1708–1717) under the Duke for nearly a decade, maintaining a respectful, productive working relationship.
Bach composed many of his greatest organ works (Toccata & Fugue in D minor, "Great" Preludes & Fugues, Orgelbüchlein) and cantatas during this tenure. The Duke supported his music, even granting a raise in 1714.
Bach did accept a new position (Kapellmeister at Cöthen) in 1717, which the Duke initially resisted—briefly imprisoning Bach for "stubbornly forcing the issue of his dismissal." But this was a contractual dispute, not an escape. Bach left professionally, not furtively.
The Weimar years were foundational. No prison breaks—just a musician negotiating his worth in a feudal system.