"The legality of this system was challenged in the United States by Accolade in the court case SEGA vs. Accolade, which ruled in Accolade's favor. The verdict set a precedent that copyrights do not extend to non-expressive content in software that is required by another system to be present in order for that system to run the software."
In case of Nintendo, it sounds like a unlicensed cartridge still had a choice to work on the Gameboy and NOT infringe the Nintendo trademark. But if it decided to show the Nintendo logo on bootup, it explicitly infringed on copyright...
Additionally, I'd guess the goal would be to freeze after the wrong logo scrolled down, but you might not be able to read the logo back from display memory. It's also possible the boot logo scrolling was done early, and then they added the logo check later?