Cannae had a fairly strong grip on western minds even before Clausewitz - not that I have come across any evidence that Lee read Clauseewitz, or at least not in any depth. But it's not clear to me that Lee was (OTL) ever
especially focused on it as a model tactically. In OTL he did attempt dual flanking attacks on three obvious occasions - Glendale, Second Manassas, and Wilderness - but at Glendale and Wilderness they seem to have been spur of the moment, opportunistic decisions, and not one of them offered a Cannae-like opportunity for the destruction of the
entire opposing army. (I think E. Porter Alexander was probably right that Glendale was the closest he ever got to pulling it off, and even so it would only have encompassed the destruction of 4 of McClellan's 9 divisions.) Usually Lee was outnumbered enough that just a single flank attack was all he could hope to manage, and likewise while he faced his share of slow and sickly Union commanders, none of 'em were as obtusely cooperative as Lucius Aemilius Paullus and Gaius Terentius Varro. At Gettysburg Lee tried a different tactical strategy on each day of the battle, and those strategies were influenced a lot more by Napoleon than they were Hannibal - sometimes for good (Day 1), and sometimes for ill (Day 3).
In our moment of Lee Revisionism I think we still have to give him his due, as a general. Whatever his faults he wasn't a moron; his correspondence makes clear that he understood at the time how badly the war-making power of the North was stacked against the CSA. His thinking in the Gettysburg Campaign wasn't to crush the North outright - that was far beyond his capabilities - but rather that any reasonably decisive victory on northern soil might create enough peace sentiment to force Lincoln into talks. An Austerlitz would be nice, but even a Wagram might suffice. In any event, Lee could at least plausibly tell himself that he knew the northern mindset than Hannibal knew that of Rome. I think he underestimated that willpower, or at least Lincoln's; but I don't think he would have been wrong to think that the North could not bear the kind of bloodletting Rome suffered in 218-216 BC.
I would also recommend reading Gary Gallagher's
The Confederate War. Gallagher makes a good case that Lee was fighting the kind of war the Southern public demanded, that moreover Lee's string of big splashy (but bloody) victories in 1862-63 were critical in sustaining Confederate morale for as long as it lasted in the face of what were frankly longshot odds and horrific losses - and that, more to the point, Lee was aware of, and acting partly in response, to this dynamic.