There is no statement in the WD that Return Code values are "global" rather than being specific to a particular control packet?
From Roger Light on mqtt-comment:
In table 3.13 for disconnect codes, the code 139 is "server shutting
down". In table 3.6 for pubrec return codes, the code 139 is "topic
invalid". This looks to be a typo in table 3.6 because code 144
already exists for "topic invalid".
The description of the return codes is a bit inconsistent. Sticking
with the invalid topic case, it is variously described as
Topic invalid : The topic is invalid
Topic Filter not valid : The topic filter is correctly formed, but is
not allowed for this client
Topic name or filter not valid : The topic name or filter is valid,
but it is not accepted by this client or server.
I see that these apply to different scenarios, but the different
descriptions are confusing. Should I take "the topic is invalid" to
mean that it is not correctly formed? What is the difference between
"is correctly formed" and "is valid"?
I don't think descriptions of a term should just repeat the same words
as the term itself, it doesn't clarify anything.
I've spotted some more overlaps in return codes.
Return code 154 is used by both pubrec and puback as "qos level not
supported", and disconnect as "alias not supported".
Return code 159 is used by subscribe as "subscription identifiers not
supported" and connack as "connection rate exceeded".
Some return codes aren't used - 141, 147, 148.