AJAX WP_Query’s order and orderby parameters not working

Found the solution in case anyone is having the same problem. Before the Query call I ran:

remove_all_actions('pre_get_posts');