jenkins parameter behaves differently from internally defined variable
It seems that the jenkinsParam is holding the output after escaping the special characters.
You are assuming that jenkinsParam = "test\ntest" and however it looks like it stores it as jenkinsParam = "test\\ntest"

See how it behaves if I use echo it these two different cases:

(I have tested this in groovy shell)

1st Case:

jenkinsParam = "test\ntest"
print jenkinsParam
test
test


** 2nd Case:**

jenkinsParam = "test\\ntest"
print jenkinsParam
test\ntest


In order to replace the payload which is stored in the jenkinsParam (2nd case behaviour), you need to replace the complete \\n from the string. Check the example below:

output = jenkinsParam.replaceAll('\\\\n', 'yes')
print output
testyestest