If you viewed the source and reproduced a software project you don't have a license to redistribute, that's cut and dry copyright violation. If the code looks similar enough you are toast. That's why there's the concept of a "clean room" reimplementation. The same is true if you feed the source into the context of an LLM and asked it to reproduce it. You have done nothing but introduce the possibility of transcription bugs.