The root of the problem is in the method for that command here:
https://github.com/bitcoin/bitcoin/blob/ca37e0f33980a1fe96ac4ed08fd7d692a7a592a5/src/wallet/rpcwallet.cpp#L1968The statement determining whether to show the message or not is this
if (!pwalletMain->IsCrypted() && (fHelp || params.size() != 1))
--snipped display message code--
As you can assume, this states that if the wallet is not encrypted and either help is true or parameters is not one, then display the help message. As you can see with that logic, since your wallet is encrypted, it will skip past this, even if help is true.
Help is set to true in this file:
https://github.com/bitcoin/bitcoin/blob/240b30eaf0b94a0094b8943dd9c01448bc29c3ba/src/rpcserver.cpp by using the help command. The key part is at line 226 - 227 which are as follows
if (strRet == "")
strRet = strprintf("help: unknown command: %s\n", strCommand);
since the string that encryptwallet method returns is empty, this help output assumes that the command doesn't exist, so it prints the unknown command message.
This is clearly intentional. Why would they have a specific check for whether the wallet was encrypted or not for the help message. As to why that was done, I don't know.