Continuity mistake: When Gilderoy jumps into the entrance to the Chamber of Secrets you see his cape go flowing up above his head. In a short second shot, taken from above, it's not. (01:59:40)
Continuity mistake: During breakfast at the Weasleys, when Mr. Weasley asks, "What is the function of a rubber duck?" Ron turns his head toward Harry waiting for his response, but in the next shot Ron is looking down at his food, before they all turn their heads to look out the window at Errol.
Continuity mistake: Tom Riddle's uniform tie is different to the current ties in the first two Harry Potter films. Yet it matches the style of the students ties in the rest of the films. The mistake here is that Tom Riddle (at school) was before Harry's time at Hogwarts, but I guess when the costume department changed the ties, they didn't realise they should give Tom Riddle an older one as per the first two films.
Continuity mistake: When Harry is grabbed by the Hand of Glory, it grabs by his knuckles. Camera cuts to a view from behind the hand and it has moved a fair way up Harry's hand instantly. (00:15:20)
Continuity mistake: When Snape yells Expelliarmus and shoots it at Lockhart, he puts his left hand behind him. But, on the next overhead shot, his left hand is now stretched out to the side of him.
Continuity mistake: When Harry has Tom Riddle's diary and starts writing into it, he writes "My name is Harry Potter". You can see by the way he writes it he doesn't put a full stop (period) at the end of the sentence. But in the next shot of the diary, there suddenly is a full stop there.
Continuity mistake: Hermione tells Harry and Ron to grab the robes after they pass out, but the next scene she has Slytherin robes from the laundry.
Continuity mistake: When running from Aragog, there is one quick shot of the back of the Anglea and the hole that was punched into the back window by the Whomping Willow has vanished to return only a few seconds later.
Answer: Yes. It's a common occurrence in a lot of movies for actors to forget their original lines so they improvise something to help move the scene along and not break character. Tom did this because he forgot what his original line was.