This also adds test coverage for the remove command which was uncovered before.
PR description:
> The `addnode` RPC with the `remove` command parameter is used to remove a node from the "added nodes". It did not have test coverage and in case of failure to remove the node it responded with the confusing message "Error: Node has not been added.".
> This PR adds test coverage as well as changes the error message to something that makes sense.
This is a backport of core#19696