The first three digits "550" are the code that is necessary for the SMTP protocol. This is used during SMTP dialog to handle errors, success or failures.
The dotted version is the so called extended return code. In this code you can specify a more detailed response for humans or automated scripts. But they are not necessary for an SMTP server to work.
But what you need (when you use extended error codes) is the numerical error code followed by a dotted one. Not the other way round. And not only the extended error code without the numerical one.
The values don't have to be equal but they have to match. So you can have a "554 5.7.1 Service unavailable". Both have to start with a 5 but don't have to be equal in the last part.