There are coaches that know the rules.
There are officials that don't.
But by and large, due to the way games are scheduled (for officials) and the training available in most area, I think it's a safe assumption that the officials on the field (at least collectively) will know the rules better than the coaches on the field.
You mention that officials don't get fired for bad calls - but they do. They most definitely do.
You may be the exception among the general coaching population, and I would agree that the rules knowledge of the average varsity coach is far better than that of the average subV coach. Most of the stories you see here are the worstcases - there's not much point in making a post where nothing exciting happened and the coaches knew the rule!

Also - many of the horrible coaching interpretations are at lower levels, but I'm sure you've worked across the sideline from someone who didn't have the slightest clue more times than you've worked with officials that didn't. At least one can hope that's the case.