You are using the wrong endpoint. The counts endpoint only returns the number of tweets for that query and has different request fields. Please read the documentation, this is the end point you need: https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-all#Optional
Additionally, the error message can tell you a lot about what went wrong. If it is something we haven't encountered you can Google it and find an answer quickly.