Unformatted error message will just return the key used to lookup the actual error message. In this case the key is invalidCodeMessage. You can change what text is displayed for this key by creating a custom theme, add a message bundle with a different value for that key. Messages should be changed this way, not by editing the template so there's no need to pass the "unformatted message" to the ftl.
One issue is that this specific key is used for a few different errors, including:
* A user clicks on the link again after it has been completed
* The link expires
* A user spends to long trying to login so the code is removed
Ideally we'd have different keys for different scenarios, but it's hard to identify which is the problem as the code has been removed we're not actually sure what's going on.