(Lots of D-Day threads, but don't see this one often. Search only brings up one result from years ago, which didn't get much response.)
In the middle of Rick Atkinson's wonderful The Day of Battle, the second volume of the Liberation Trilogy, which covers the war in Sicily and Italy in 1943/44. It really brought home for me how dicey the landings at Salerno in September of 1943 were and how close they came to being driven into the sea. At one point, Mark Clark seriously contemplated giving the order to evacuate, which horrified the naval commanders, who expected only about half the landing force to be taken back off if they were incredibly lucky. Also telling was the fact that the Germans had two panzer divisions within supporting distance, which were left uncommitted until too late.
Suppose, therefore, that things had gone even worse for the Allies and the two panzer divisions had been committed to the counter attack. Clark gives the order to evacuate and the majority of the men in the landing divisions are killed or captured, with the additional loss of the landed material. We can also imagine that a significant number of ships offshore are sunk by the Luftwaffe.