Every book on Gettysburg that I've read, by Sears and Trudeau and Wert, detail how Lee ordered Stuart to support the infantry charge by riding around the Union right flank and down the Baltimore Pike in the Union rear. The attack was as big a folly as Pickett's attack was because Stuart's men were tired and their mounts worn out from his joy ride through Pennsylvania. Union cavalry were able to repulse Stuart's men, though stupid leadership on the part of Kilpatrick led to heavier Union casualties than should have been necessary.
In General Lee’s report of the Gettysburg Campaign to President Davis, he does not report ordering Stuart to carry out such an action. He details the orders given to Ewell, Hill and Longstreet. He details the orders given to Pendleton and Alexander, but nowhere does he mention any orders to Stuart for the actions on the 3rd day at Gettysburg. Lee does praise Stuart for his “protecting the left flank of the Army” on the 3rd day at Gettysburg. The theory that Lee ordered Stuart to attack the rear of the Union position at Cemetery Ridge while Longstreet’s forces the Union front is just that, a theory, there is no solid evidence to support that contention.