Gettysburg was an unplanned engagement; some amateur historians have called it a mistake on both sides.
Coulda, woulda, shouldas abound.
If Ewell had attacked the unconsolidated Union forces at the end of the first day. If J E B Stuart had not been so far afield he did not arrive until late in the second day. And many lesser ifs.
But the imbalance of forces with 97,000 Union defending high ground against 72,000 Confederates seems like a foreordained conclusion.