Are callbacks supposed to only work when added after the figure is shown?

This puzzled me a lot, as there are many examples (even in the docs) where callbacks like FigureWidget.observe(…) or trace.on_hover(…) are added before the figure is shown.
However when doing this, the callbacks never get invoked.
Only if I call these registering methods AFTER displaying the figurewidget, the callbacks indeed do get invoked. Is this the way it is supposed to work? Is this documented anywhere?

For example, from the documentation here, I would not have understood that one has to add the callback after showing the figurewidget: plotly package — 5.11.0 documentation