No this is untrue. Independent creation is an affirmative defense against copyright infringement. You'd never convince a jury that you independently wrote the exact same article as a New York Times article, but in principle you can argue that you independently wrote say... a song, or even reimplemented the WIN32 API without ever having read or familiarized yourself with the original source code:
https://github.com/wine-mirror/wine
https://harvardlawreview.org/print/vol-128/creating-around-c...