In all of wars what prevented a soldier who country was invading another or vice versa just walk off and say screw this. Find a town to settle down in and just start a new life?
It can be hard to start over in a new place when you don't speak the language or have any ties. You might be killed by locals if they think you're a spy. If your army caught you, they would have you killed.
Assuming your service ended at that point and you were free to leave, it'd certainly be easier than deserting into enemy territory. France just after WW2 was pretty war-torn and full of refugees, so it wouldn't have been the easiest place to live for the first several years at least.
Didn't the news have a story not that long ago about that one US solider who went into North Korea? I swear didn't happen that long ago. I think they kicked him out anyway, but I wonder what he's doing now.