If it's from the Peninsular and after 1812 then it's highly likely that the officers depicted just hadn't bought regulation shakos yet, so they kept wearing their old bicornes.
There was basically no way to enforce these new regulations on troops that had been in Spain for the past few years, after all.