We estimated the story task 'As a developer, I will code the create user functionality' to include all coding for that unit of work including fixing any bad code that was written.
We estimated story task 'As a QA associated, I will test the create user functionality' to include all testing for that unit of work including defects found during execution of the task.
We want to track open defects and their progress. Why then would a defect due to faulty coding that is identified during the sprint and must be fixed during the sprint show up on the burn down as scope change. This is not a scope change. We never assume that all code will have no defects. The goal of the sprint is to make sure the code will function at the end of the sprint.