Your visualize_geo method returns a ploty.express.choropleth figure to Jupyter notebook. Jupyter notebook knows how to show it.
But when matlab calls your python script, Jupyter notebook is not in the picture. None is showing the figure.
Maybe you just need to call
fig.show()
before you returning fig in your visulaize_geo method?

