When one door closes/shuts, another one opens
The earliest citation found for this is Fernando De Rojas (c.1465-1538) in La Celestina Act XV, “When one door closes, fortune will usually open another.” The Oxford Dictionary of Proverbs gives the source as Lazarillo de Tormes an anonymous Spanish novella published in 1554. It first appears in English in the late 1500s and Cervantes uses it in Don Quixote (1605). One suspects it existed in Roman Latin before this, but the source has not been found.