It was typical for a coding book, to contain broken code?
There were a lot of issues in delivering code via print back in those days. It wasn't like today where you could easily just share digital source files, every system used their own storage formats, and there wasn't a (functional) "net" to transfer files over. Program source files were often re-typed into a word processor by the publishers to get them into their system of choice.
Even if you were to digitally transfer the file to the publisher (via modem), if they moved to a different system for typesetting, they still might not render properly. For example, Atari computers used ATASCII characters (mostly ASCII, but with special Atari charcters as well). Other systems didn't understand the ATASCII characters and would substitute from their local character set. So, if you had a source file with something like the ATASCII "clear screen" character in your original source, it most likely wouldn't print out in the book/magazine correctly, leaving you with code that either didn't work, or behaved differently than expected.
Some magazines would solve this by just taking native printouts and physically cutting/pasting them into the magazines. You'd see that source for each system came from a different printer (some dot-matrix, some daisy wheel, etc.), so that they could work around character issues by printing from each system natively.
They also started introducing a checksum system for entering code. Each line would have a 2-character code printed next to it, and if you entered code using their entry system, it would calculate the checksum of what you entered and you could compare checksums to see if you got it right. Though, sometimes there were errors in the checksums themselves, so you'd sometimes swear you got everything right, but it would still give you the wrong checksum.
When you entered code from a magazine, and it actually ran, you felt great - like you really accomplished something.