The reasoning that FerretDB is relying on in order to "use" the MsgHeader structure and other elements in the wire protocol (without complying with the BY-NC-SA license) is stated in the README.md document of FerretDB:
FerretDB (previously MangoDB) was founded to become the de-facto open-source substitute to MongoDB.
[...]
In its early days, its ease-to-use and well-documented drivers made MongoDB one of the simplest database solutions available. However, as time passed, MongoDB abandoned its open-source roots; changing the license to SSPL - making it unusable for many open source and early-stage commercial projects.
So, the developers of FerretDB do not consider it to be an adaptation of MongoDB; they consider it to be a substitute for it.
Does this mean that if I want to create a commercial database or opensource database with DAAS offering, I cannot use this message structure, ie this series of 16 bytes?
In my opinion, "use" in this manner, it is too broad/ambiguous of a word to consider in a copyright license. Even though that word appears in the note at the top of the MongoDB Wire Protocol Specification document, the document also states that the governing license for the specification is the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Note that that license governs only the specifications document, not the facts inside it. For the example presented, the fact is that the MsgHeader structure contains 4 32-bit integers representing the message length, request ID, response "To", and opcode. The only copyrightable element would be how that fact is represented in the document.
If you translate that fact into code in the language you're writing, and if there is only one way or only a few ways to express that fact in that language, then that must be excluded from a copyright analysis in my opinion, so I would not consider it to be therefore based on or adapted from the specification, in the copyright sense.
This is all speculation on my part, but here are some other possible ways that the MsgHeader definition may have made its way into the FerretDB implementation (and probably any other software packages that understand this protocol) without it being an adaptation from the Specifications document:
The developers didn't use the above document in their development, but instead used an earlier published version (i.e. before October 2018) from a time when MongoDB's documentation and/or source code were available under an open source license that explicitly allows this particular use.
The developers didn't use the documentation at all, but instead analysed MongoDB's message outputs themselves using protocol analysis tools and developed their own specification of the message header based on that analysis.
The developers did make use the current protocol specification document, but did so in a way that does not require copyright permission. Even though the document says "you may not use this material for any commercial purpose", a document license cannot prevent you from using the document in a way that is otherwise allowed by copyright law.
See also: Can I cleanroom code by myself, if public specifications already exist?
See also: https://law.stackexchange.com/questions/81159/is-this-copyright-infringement/81169
... how did Amazon get away with [implementing the protocol] with their DocumentDB?
I don't know the answer to this. But if the information in the MongoDB Atlas vs. Amazon DocumentDB comparison page is accurate, then it appears as though the Amazon implementation is "based on" (in a functional sense; not in a copyright sense) an earlier version of MongoDB, well before it was changed to the SSPL license.
Note that MongoDB, Inc. also offers so-called "commercial licenses" with special terms. I suppose it's possible that Amazon has a special license from MongoDB, Inc. to put the protocol implementation in their product, but if that were true, then I'd be surprised that MongoDB is publishing the above comparison page in such an unflattering way to Amazon.