Sorted bar graph in facet_grid

As far as I understand, there isn't a straightforward way of reordering the X-axis levels within each panel according to another variable, especially when doing so according to two other variables, as it is your case (type~fact).

This issue may be similar to: https://forum.posit.co/t/how-can-we-arrange-the-bars-for-each-facets-grid-in-ggplot/31512

These discussions may be of help I you feel like trying a workaround: