The word flan itself is a relatively recent addition to English, adopted on our behalf from French by the chef Alexis Soyer (a Frenchman working in England), but in that form it is in fact simply a reborrowing of a word which originally crossed the Channel in the 13th century as flawn, denoting some sort of custard tart or cheesecake.
Source: wiktionary