Can't move files or folders to some positions

It's something I've seen before but cannot reproduce at will.
It's easiest to repro if you're dragging close to another item with a longer name, but that doesn't always seem to be the issue.

Usually it requires some combination of toggling Sort by… or Snap To Grid - though that will upset a lot of otherwise carefully-placed icons that you'd have to reset afterwards.
if you'd rather not do that, then if you hold Cmd ⌘ as you drag, it will stay where you put it [not snapped, but you can usually get it close enough by eye]

Sometimes you can clear it by enlarging the grid spacing on the desktop, or reducing the font size - then when you return it to your previous settings, the issue magically goes away.