I can confirm that 'Trim leading & trailing whitespace from strings' on import and the GREL trim() command work differently.
The detail:
Trim leading & trailing whitespace from strings -> uses the Java String 'trim()' function defines whitespace as any character with a code point less than or equal to the space code point (\u0020)
I don't know why these are different but it seems likely to me this is just some code history rather than something specifically planned. A Github issue could be created to bring these two things into line with each other if that was desirable (and that could be a place to discuss the impact, if any, of making such a change)
Owen