There I think it would have been a case of safety in numbers.
Deserters were well aware that if caught they would most likely be shot. Some were, of course. You can shoot one; you can shoot ten; you can shoot twenty; possibly even fifty. Once you get to five hundred or a thousand men - more - shooting them becomes a far trickier prospect, especially given that the men we're talking about were by definition armed.
Any revolt relies on taking a large number of others along with you to succeed.
Only a couple of hundred people were actually shot in the end. Several thousand were convicted and presumably punished in other ways.
Shell shock, which I think we would recognise as a form of PTSD nowadays, was a recognised illness even then, although its nature was disputed. Some people thought it involved physical damage to the brain, some thought it psychological, but surprisingly for the time, people didn't seem to think of it as a form of cowardice.