When you drag’n’droped the Spotlight search bar around in macOS (yes – you can do that actually!), you may wonder how to put it back at it’s original centralised position on screen…
It’s as simple as Click + Hold
the left mouse cursor
for a few seconds on the Spotlight-icon in the top right corner of macOS’ menu bar.
Just used this in 2023 on macOS 13.5 Ventura successfully.