The client code (and the internal documentation states the client code is shared by this older tool) doesn’t inherit the environment of the user context that we run as, so its very possible that %userprofile% isn’t defined when we run like this.
Also, if the current user can’t read that location, it will fail.
If you are just copying a file into the current user profile, then you don’t need to do it this way. You can just copy the file as the system account to the current user location that you determine dynamically using relevance.
If you want to enforce JavaPolicy then it shouldn’t go in the current user profile anyway.