go.FigureWidget layout updating itself when re-running cell

When re-run a cell displaying a fig = go.FigureWidget(...), i.e. a cell only containing fig, then some of its layout properties are reset for no (apparent) reason.

In my particular case, it concerns at least the fig.layout.paperbgcolor, fig.layout.plotbgcolor and fig.layout.modebar.

It happens when re-running the same cell, when manually running a new cell that also only contains the same single fig statement, or when manually running a cell containing the %rerun magic.

However, and that is strange, all of above cases don’t create that bug if all cells are run through the "Restart & Run All` shortcut.

I provide a jupyter notebook example as a gist (as I said, manual run needed for the bug to happen).