Fatal error: Uncaught Error: trim(): Argument #1 ($string) at \wp-includes\class-wp-query.php

The problem is name[], specifically name. When you are choosing what to name your inputs, keep in mind that WordPress itself has inputs and by choosing "name" you’re reusing something that’s already in use.

E.g. example.com/mypage is converted into index.php?name=mypage behind the scenes, and used to fill up the main query. By reusing name you’re putting something in the system that isn’t meant to be there. It’s expecting a string because page and post names are strings, but your form uses an array.

So rename your name[] input to something else that isn’t already reserved. You can look up the WP_Query documentation to see all the options that class takes ( and that you should not use )