If he did this he would certainly suffer a coup at home.Well. Sorry to contradict once more. But such a kind of mistake would be too big to be crédible.
Though a mistake because it turned into a quagmire, Spain was a much smaller mistake than such a lenient peace with Britain. Britain had been France's arch-enemy for more than a century. It had taken away its enormous colonial empire in north America and in India.
What you are describing is the same as the coalition, in 1814, defeating France on its homeland and leaving Napoleon keep his domination on Italy, Germany and Spain.
I think this just can't work.