I haven't played around with custom cursors myself, but looking at the sfml source the sf::Cursor class destroys the allocated system specific cursor when it goes out of scope.
To me, the code looks like sf::Cursor should exist for the lifetime of the program, not be a temporary in PrepareMouseCursor(). So perhaps it's holding a residual image while in the window, when it leaves the window then returns the cursor you set no longer exists.
Try moving the sf::Cursor out of the function and maybe put it where the renderWindow is, so it has a similar lifetime.
(Technically: Win32 DestroyCursor() is called when sf::Cursor destructs)