I think the question can be summarized as "do companies have an obligation of mean or an obligation of result in searching for similar code."
I unless you have a search engine that can search all code across all repository, public or not, it is pretty hard to ask for an obligation of result.
Moreover, in many countries you cannot copyright the code itself, but you can copyright complete algorithm (RSA would be a good example, but not the code implementation itself), or a specific feature (minigames during loading time).
Note that I do not say itis right to do so, I'm all for opensource softwares, but I take into account that some people make a living from their inventions, so I'm generally in favor of limited copyright protection (in terms of both duration and scope).
An invention property, a software engineer code, or anything like that, should be shared by both the inventor (for inventing it in the firstplace), and the one financing it (for paying for it), at least until it pays back the money invested.