Short answer: update to Still Dock 1.33. From 1.33 the One display lock and the Size lock keep working after your Mac has been locked or asleep for a long time.
The One display lock and the Size lock watch the Dock continuously and put the Dock back when macOS moves it or changes its size. After the Mac had been locked or asleep for a long time, that watching could stop. The Dock then moved to another screen or changed size and nothing put the Dock back.
Still Dock 1.33 keeps the watching running while a lock is on, and starts the watching again when the Mac wakes, when you unlock, and when a screen is plugged in or unplugged. Still Dock also writes a line to its log if the watching ever stalls.
Write to hello@littlebirdtrading.com with your macOS version and how long the Mac was locked.
More on a Dock that will not stay put: keep the Mac Dock on one monitor and the Mac Dock keeps changing size.