By default, getPosition works in desktop (screen) coordinates. If you aren't using a fullscreen window, the mouse coordinates will be off by a bit.
You can make the mouse position relative to the window by passing the window to getPosition().
See if this helps:
sf::Vector2f p = win->mapPixelToCoords(sf::Vector2i(sf::Mouse::getPosition(*win).x, sf::Mouse::getPosition(*win).y));