Kids can do errors in writing till 6-7 years of age. This is not a problem unless there are other issues with learning and attention.
She is self correcting so that's good.
Don't worry about this.
If she has difficulty with remembering letters and sound associations, trouble focusing then you may consider meeting a developmental pediatrician.
Next Steps
don't worry if the child is able to self correct and is otherwise attentive and alert.