Equal hashes for different messages when doing key length extension attack sha1
Is this the normal behaviour?


No, it is not.  While it is known that SHA-1 collisions can be found, it's a lot more work than what you do.

It's likely to be a bug in your code.  I went through your code, and I'm not sure whether you might be computing the hash of the same preimage each iteration - that would certainly cause each hash to be the same.