if you click the custom titlebar of your dock widget you'll notice the drag won't start in the same place you clicked, there's a slight offset, if the window has custom margins.
This isn't usually a problem, since the window will be frameless by default, but it's possible to use custom title bar with native window frames, which gives you nice drop shadow for free.
The fix should be simply a matter of adding the margin
|For Gerrit Dashboard: QTBUG-58843|
|185797,2||Take window frame into account when dragging dock widget||5.9||qt/qtbase||Status: MERGED||+2||0|