Hey, i had an issue when i use a scattermapbox for the first time. The legend is not sort. When i reload, it adjusts itself. I use the property category_order coupled with color_discrete_sequence.
If anyone knows how to fix it you save the day.