Output mismatch in backend but working as expected on front end

The code logic works as expected on the frontend, but

In the backend,
In the json file if we are passing the filers in the specified order the expected output matches with the real output

In the json file if we are changing the order of the filers the expected output does not matches with the real output

The same functionality works on the frontend

we need the root cause why the output differs if we change the order of the filers.
(Generally the order of the filers should not effect the output.)