The Confederate Battle flag did not become associated with slavery until the Civil Right era of the 1957 Arkansas, Mississippi, and Alabama desegration fights.
Even then that flag was used as an anti-government intervention symbol because of the illegal use of the United States Army 101st airborne division to control what was otherwise a civil disturbance in Little Rock in 1957.
But the News media and the uninformed educational system has made the flag what it is today.