Admittedly Wikipedia, but:As usual your thinking & the accepted casualty figures are not the same. You really should read the books before you speculate.
Peninsula Campaign lists 29,300 (and at that, that actually includes battles from before Lee took over; it'd be only 20,000 if only counting the Seven Days)
Northern VA campaign lists 9,200 (so I counted high by 300)
Maryland Campaign is 16,900 based on my own research and is much greater than the Wikipedia count (which counts 10,300 in the Maryland Campaign, though 12,051 at Antietam itself!)
Fredericksburg is 5,400
Chancellorsville campaign on Wikipedia is 12,800, so I counted high by 6,200
Gettysburg is "27,000-32,000 estimated" so that one is a low count - call it 30,000, so I undercounted by 4,300
Bristoe has about 1,400 Confederate casualties, and Buckland Mills has 400; 2nd Rappahannock Station has 1,700.
Mine Run was about 700.
The Overland is "30,000-35,000 estimated", so I think 31,800 is reasonable.
Petersburg has an estimate of 28,000 on Wikipedia.
So all the pre-Appomattox ones total (via Wikipedia, except my own for the Maryland) to 167,600, when including Seven Pines and other pre-Lee battles. Appomattox has the main battles being Five Forks, 3rd Petersburg and Sailor's Creek, and those add to 15,800, but even assuming 25,000 casualties in the Appomattox Campaign it still only gets to 193,000.
Obviously some of these are "estimated" but since I used the high value for the Peninsula and the high value for the Maryland I'm actually including around 14,000 casualties more than the accepted values, before counting Appomattox. For the 240,000 number to work there has to be between 20,000 and 40,000 battlefield casualties which aren't in any of the above...