Okay, then it was intentional. Then the execution is correct. But I'm not sure that your design is quite there.
Swapping the first and last elements won't make them random, it'll just make them different. What is it you're trying to do with this swap? How does it fit into your larger goal of returning a random permutation of the characters in a string?