En fragante or in fraganti is, as evidenced in many sources, a distorted form of the Latin expression in flagranti:
in fraganti
Tb. infraganti.
Del lat. in flagranti [crimĭne] 'en flagrante [delito]'.
The expression fraganti came about through a process of metathesis by which the /r/ moved to the place where the /l/ used to be, and the latter was dropped. There is a possibility the Latin word fragante also promoted such a change, as proposed by Fernando Díez Losada in the journal column La tribuna del idioma:
La expresión latina auténtica es in flagranti (in flagranti crimine/delicto), que en el siglo XVII se castellanizó en la forma en flagrante (con frecuencia acompañada del sustantivo delito). Posteriormente se dio un fenómeno que podríamos considerar de asimilación consonántica: flagrante se convirtió, en labios del pueblo, en fragante (tal vez, incluso, por influencia del adjetivo fragante: oloroso, aromático). Con ello se consideraron correctas y se alternaron las dos expresiones: en flagrante y en fragante.
The distorted form certainly isn't new, dating back to at least 1505:
El marido que matare por su propia autoridad al adultero & ala adultera avn que los tome infraganti delito y sea justamente fecha la muerte no gane la dote ni los bienes del que matare (...).
Anónimo (1505). Leyes de Toro. Real Chancillería Valladolid. Pergaminos
The cluster /fl/ was kept in other forms derived from the same root such as inflamar or flamígero, but it also evolved to a /ʎ/ and eventually a /ʝ/ in most dialects, giving us the cognate doublets flama and llama or flamear and llamear.
So to answer your question, to what extent the Latin word fragante affected the evolution of flagrante isn't easy to tell, but it is a plausible explanation. After all, two words don't have to be semantically related to influence each other; if that were the case, malapropisms wouldn't exist.