Firstly, the “Lock Toolbar Position” option is not visible for docked toolbars. Secondly, for floating toolbars, the “Lock Toolbar” option is inaccessible or greyed out.
“Drag the title bar of the toolbar to an edge of the document window”, so it became reattached; then right-click an Lock.
More LibreOffice Help on Using Toolbars.
Add Answer is reserved for solutions.
Add comments below the question if you want to add more information; also can comment an answer.