replit is not open source though. Only some parts of it are.
You can infringe copyright without copy-pasting code. If I read Harry Potter and the Philosopher's Stone, burn my only copy of the book, then write and publish Jerry Schmotter and the Alchemist's Gem, a novel about a teenage boy with a star-shaped scar, etc., I'm probably infringing copyright even if I didn't word-for-word copy any part of a Harry Potter book.
There's a reason why "clean room" design exists; to maximally protect yourself against claims of infringement, you want the implementers of your copycat product to not even have seen the original implementation:
https://en.wikipedia.org/wiki/Clean_room_design
Copy-pasted code is a smoking gun but it's not necessary.
(I really have no idea if replit would have a case though. Seems dubious. But generally Copyright law is murkier than what some programmers think.)