Proxy inverso reescribe el dominio en enlaces externos de los mensajes

That sounds a lot like this issue although I don’t think it’s exactly the same. Apparently IIS is decoding the URLencoded part first, and then replacing everything in front of the last ?

Can you post the relevant part of your IIS configuration here?