Again, it's all custom code made by studying and debugging the game in itself, which has been stated since the 90s to be completely legal. Just look at emulators, they follow the same rule of thumb, disassembling and RE consoles made by the same companies that made the games.
I suggest you take a look at the Bleem case that went down in the 90s with Sony, and which they lost.
Nintendo tried the same in the 90s but failed miserably, and they won't attempt doing the same here because there is already a precedence of them losing under very similar circumstances.
If we go by your logic, then all emulators should be illegal too, and we know very well that is not true (thank god for it).
Nintendo can't take the code down because:
1) It doesn't have any assets from their IPs. This was the main reason why they could take down the binaries but not the source code of the project. If the source code itself doesn't have any of Nintendo's copyrighted assets, like imagery, music, etc., they can work with the source code as a simple generic 3D platformer engine.
This is why they focus on the users providing the ROM for the extraction of the assets and further compilation for their own use, and not the distribution of binaries.
2) The source code was all made from RE. Since the code itself is not a 1:1 recreation of Nintendo's, nor a leaked code, they have every right to exist.
Also, if you still think Nintendo is in the right to take this down, take a look at this:
https://www.eff.org/es/issues/coders/reverse-engineering-faq#faq2
It has a list of a lot of examples of RE being protected under the law, and it also lists the examples of Bleem I mentioned, and others from big gaming companies.