One of two things happened to the soldiers left in Egypt, of which there are two case examples.
First, they could have been killed by angry natives that opposed secular French rule. The assassination of Kiebler, whom was left behind as governor of Egypt, by an Anti-French student gives the worst example.
The other option was that they were collected by the British and shipped off to France. The would be Marshal Davout was one of these. He was captured by the British and shipped to France in 1800 but didn't arrive in time to participate in the Battle of Marengo.