Most native English speakers would find nothing strange about an “empty box of matches” or an “empty bottle of beer.” They would readily interpret these phrases as a “box [for] matches” or perhaps a “bottle [previously full] of beer.”
If you pointed out that “empty matchbox” or “empty beer bottle” is preferable, a fluent English speaker might agree, or might just shrug and wonder what the big deal is about. Diction choices like this are a matter of style, and poor choices are style errors. Most rules of style are subjective, so what looks like a style error to one writer (like the authors of your reference book) might be perfectly acceptable to another. One of the functions of a style guide is to recommend specific choices for diction, spelling, punctuation, formatting, etc. to maintain a consistent style in publications.
Note that this construction is not a grammatical error, at least not as the term is used by linguists. Jeremy Butterfield aptly notes that “Grammar is often a generic way of referring to any aspect of English that people object to.” While linguists and other serious language enthusiasts use grammar to mean a variety of things, it generally relates to the structure of language rather than its meaning. Thus, phrases like “this serious kerfuffle of parsnips” are grammatical even though they might not make sense at all, because there's nothing wrong with the structure of the phrase. The same is true for “empty box of matches.”
All that said, many native speakers would object if you changed the example slightly:
This bottle of beer is full of milk.
We call this kind of style error a garden path sentence because readers are lured down one path (thinking that the bottle is full of beer) and then suddenly surprised by what they find at the end of the sentence (that it's actually full of milk). A garden path sentence forces the reader to suddenly re-interpret the sentence to make sense of it, often requiring a completely different parse of the grammar. For example:
Time flies like an arrow; fruit flies like a banana.
Note: This is a copy of the answer I posted at English Language & Usage.