The deleteObjectNode() method on ReplicationServiceHandler throws TException.INVALID_OR_MISSING_PARM if given a primary storage node, which translates to a 500 Internal Server Error.
Since this is a client (caller) error, rather than a problem with the server state, it would probably be more appropriate to return a 400 Bad Request by throwing TException.REQUEST_INVALID.