I was going to make a joke about her name but
Anyway, this is what the wiki says:
"Before Half-Blood Prince, Lavender Brown played no major role, she was portrayed by two separate actresses in the second and third film and was a background character. ... Lavender Brown, as a major character role, was not cast until the sixth film. The filmmakers had no way of knowing she would play such a role when they assigned her name to the background actresses from previous films, which is why her actress changed in the sixth film."