There are, I think, some timelines on this forum which consider what could have happened if Napoleon Bonaparte had fought for Britain. However, I have not found any where he fights for Spain.
Under which circumstances could he have chosen Spanish services?
What could he have achieved as the leader of the Spanish armies?