Update: I fixed this using
fig.update_yaxes(categoryorder='array', categoryarray= ['name3','name2','name1])