I tried disabling all plugins and didn’t work. The sorting works as normal only when I disable the feature to show variations as simple products.