The asserts added in b840ba1f59 revealed the bug, which was passing the
wrong Scene pointer to `BKE_view_layer_synced_ensure` in affected code.
Issue likely introduced in 68589a31eb, was probably never actually a
crash-case because the viewlayer would always be in sync already when
this was called from the Outliner (besides perhaps some extremely rare
edge cases).
To be backported to potential bugfix release of 4.0 together with
b840ba1f59 commit.