Your usage of StrPCopy() call is not safe - regardless of the AV that is eliminated with the use of the new string that is created with the Trim() assignment.
The string datatype is more complex than PChar. It has a length component that magically sits ahead of the pointer and the character data. Casting to a PChar works, but should only be used for reading.
By casting the string to a PChar, you are allowing StrPCopy to blast the 'changed' string into that part of memory. In your example, you're copying in a smaller string, so you're OK memory-wise. The result is a very confused string (length doesn't match the string, there's a null character in the middle), but you're within it's bounds.
If your code was something like...
StrPCopy(PChar(s), PChar('changed to this string'));
... then your code is overwriting past the string's memory footprint - usually without an immediate AV. You may get away with this. You may not.