plotly.offline.plot saves plots to a file with the same name very time (unless you provide your own file name), so there might be an occasional issue where the browser is being opened before the file is fully written to disk, thereby displaying the previous figure.
You could try out the new 'browser' renderer. The renderers subsystem is a generalization of the plot/iplot approaches that we’ve built for plotly.py version 4 (documentation will be released alongside version 4), but it’s available for testing in version 3.8+ (I’d recommend 3.10). Here’s how that would work
import plotly_express as px
import plotly.io as pio
pio.renderers.default = 'browser'
iris = px.data.iris()
scatter_plot = px.scatter(iris, x="sepal_width", y="sepal_length")
pio.show(scatter_plot)
This renderer doens’t write out temporary files, instead it sets up a single use webserver and serves the plot to the browser over a local port so there shouldn’t be any risk of the wrong plot being displayed. You can also set pio.renderers.default to 'chrome', 'chromium', or 'firefox' if you want to be explicit about which browser is used.
If you give that a try, let us know how it goes!
-Jon