The gemara says that if one finds an old rusty object in a wall, he can assume it was there prior to the jews conquering eretz yisroel and therefore the finder can keep it. Tosafos asks, why doesn't the wall work as a chatzer for the owner to acquire the object that was in it, since a kinyan chatzeir doesn't need awareness of the owner to be ko'neh (it works as a shli'ach to acquire a zechus even without the owner knowing)? Tosafos answers that a chatzer can only acquire something that would definitely have been found by the owner, but doesn't have the ability to acquire something which may have never been found.
The Shita mikubetzes answers Tosafos question that a chatzer can only acquire without the owners knowledge when the owner owned it prior to the object coming into it, but in this case where the object was already in the chatzer at the time it was acquired, there isn't any kinyan chatzer. The Ketzos HaChoshen (198:2) uses this to explain the Shach who says that chatzer can only work when it is owned or rented prior to the object entering, but if the object was already in the chatzer, one cannot acquire the object simultaneously with acquiring the chatzer. However, it seems that the Shach goes beyond the chiddush of the Shita mikubetzes. The shach is speaking in a case where the owner of the chatzer is well aware of the object and interested in acquiring it through his chatzer, yet he insists that the chatzer cannot function to acquire an object that was already there when he acquired it. But in our case the owner is not aware of the object. Had the owner been aware of the object it is very possible that the shita mikubetzes would agree that he can acquire the object that was already in the chatzer when he purchases it. The reason that the shita would make a distinction whether or not the owner is aware of the object is that his sevara for not allowing kinyan chatzer to work on an object already in the chatzer is an issue with da'as. Meaning, whatever a person does not have da'as on at the time he acquires it, he isn't ko'neh - just that normally a person who owns a chatzer has stam da'as to acquire an object that would come into the chatzer afterward, but his da'as is not on objects that are already in the chatzer that he is unaware of. Therefore, if he is aware of the object, the kinyan chatzer has the ability to enable him to acquire even objects that were there prior to acquiring the chatzer.