Changing the Z-order via context menu works badly, because the changes are not shown in the object-inspector. You must restart Lazarus to see your changes.
You don't have to restart Lazarus to see the changes, you just need to switch to other form. Tested on Lazarus 1.8.4 Linux.
Is this a bug?
IMO the only way is to manually edit *.lfm
Yes, definitely is a bug. Please report it to:https://bugs.freepascal.org/view_all_bug_page.php
I reported this bug as #33954.