I found this reddit from 4 years ago after searching for the same issue:
"Is there any way to lock my docked panels? I keep accidentally pulling the group of docked panels off the sidebar. I know I can easily reset the workspace or just drag the panels back to the dock, just thought there'd be an easy option to lock/unlock them."
Just wondering if anyone has had any solutions since?
I have my workspace saved so it's not a big issue - it's just annoying to have to move the panel back in every time, seems like a simple fix to have a lock/unlock function.