In this particular instance it was the '&' that was not getting encoding and the <space>.
The reason is that WSO2 ESB uses the java.net libraries and it ends up not encoding the characters correctly.
An example as shown below:
In this what is done is that the API request values has been extracted and stored in a property using a property mediator.
In the "encodeURIComponent" yet, we still have some characters that are not encoded. These include the !'()*~.