This is an example of metathesis, the rearranging of sounds or syllables in a word. It occurred in a number of words in the evolution from Latin to Spanish:
There are even instances of this happening multiple times to recreate the original syllabic pattern:
- praelātus > prelado > perlado > prelado
This also occurs commonly with these non-standard (i.e. not recognised by the RAE) pronunciations (and associated spellings):
- croqueta > cocreta
- dentífrico > dentrífico
- calcomanía > calcamonía
- vereda > vedera
- cerebro > celebro
- guijarro > guirrajo
- programa > pograma
- neandertal > neardental
- colchoneta > cholconeta
- meteorología > metereología
Note: These changes do not occur in all Romance languages, see:
French Algérie
French miracle, Italian miracolo
French guirlande, Italian ghirlanda
Portuguese crocodilo, Galician crocodilo
Portuguese perigo, Galician perigo, Italian pericolo
But other Romance languages did in fact undergo the same change as Spanish with this last word:
Italian coccodrillo
Sicilian cuccudrillu
Vernazzese (Spezzino (Ligurian)) cuccudrìllu
Logudorese Sardinian cuccudrillu
Corsican cuccudrillu
Asturian cocodrilu
Old French cocodril
Picard cocodril
Catalan cocodril
Languedocien (Occitan) cocodril
Sources:
• https://en.wikipedia.org/wiki/Metathesis_(linguistics)#Spanish
• https://es.wikipedia.org/wiki/Metátesis
• https://en.wiktionary.org/wiki/crocodile#French
Krokodile: This is German plural; singular isKrokodil– JayC667 Nov 26 '21 at 23:08