So texture should be a uniwue identifier for each texture. But if I am trying to load different (and also textures which are already in the memory) textures. The texture id keeps the same. So that from time to time a wrong texture is mapped on a surface.
I think it could be, because OpenGL recognizes, that the texture is already loaded.
Each time you call glGenTextures you should get a unique texture ID and you need to keep that ID and re-bind it each time you want to use it.
Without looking at some code we can’t possibly do anything other than guess what is going wrong for you. But from what you have posted I am wondering if you are overwriting the GLuint texture variable you have each time you ask for a new texture ID and consequently losing the IDs of previous textures.
Your theory about GL recognizing identical texture data and ignoring them is wrong though, and from your description I really suspect something is going on elsewhere in your code.