All the bed buffaloes in the tax code are NOT the fault of the IRS. The IRS doesn't write the arcane and convoluted tax code. Congress writes the tax code and the President signs it into law.
It's the job of the IRS to take whatever tax code Congress and the President hand over to them and do their best at translating that code into terms that taxpayers can understand, often on very short notice, as Congress frequently amends tax law right up to the last minute before filing season begins.
For example, here is the source text of the Working Family Tax Relief Act of 2004, which in which Congress defined "qualifying child" and "qualifying relative" dependents on pages 8 through 32. If you look at the text of their definition, it's confusing and convoluted and full of provisions that refer to still other provisions that refer to still other provisions, some of which are ultimately circular. There are many provisions embedded in the current tax code which are directly preempted by contradictory provisions in other sections of the tax code which override them.
I think you'll agree that the IRS reference Tables in Tab C of your Pub 4012 tabbed resource guide, along with the illustrative examples in the corresponding part of Chapter 6 of your Pub 4491 are a big improvement over the tax law as Congress wrote it.
Sometimes the Congressional lawmakers themselves do not understand all the logical implications of the tax code they write, with the result that they create loopholes and bed buffaloes they did not intend. With the best of intentions, Congress was actually trying to simplify and rationalize what had previously been a confused patchwork of definitions for the various child-related tax benefits when they created the current "qualifying child" and "qualifying relative" dependent definitions. But as the American Institute of CPAs pointed out in 2005, there were definitely some unintended and paradoxical effects as a result of Congress' well-intended tax law. Some of these issues have been patched over the years since 2005 through IRS clarifications and rule-making.
So, if you see bed buffaloes in the tax code, don't blame the IRS. The IRS actually tries its best to clarify Congress' convoluted code as much as possible.