I was having the same difficulty with AC25. Moving the palette / toolbar to a docking position and it ends up placing itself randomly below or further along the dock rather than right adjacent and in the spot it was placed.
I found the following worked:
1. Drag the toolbar/palette to the desired location as accurately as you can.
2. Keep the mouse button depressed for a few seconds before releasing.
The 2nd step seems to encourage it to dock neatly.
Cameron Hestler, Architect
AC 24 & 25 (3011) / MacMini i7-8700B @ 3.2 GHz / 32GB Ram / 512GB SSD
LG Ultrafine 4K monitor 22" & 27”
Mac OS 11.6 Big Sur