must be an instance of Symfony\Component\HttpKernel\Event\ResponseEvent, instance of Symfony\Component\HttpKernel\Event\RequestEvent given

When upgrading to drupal 9, be careful with your EventSubscribers and Listeners. 

Solution

In Symfony 4.4, GetResponseEvent was deprecated in favor of ResponseEvent. In Symfony 5.0, GetResponseEvent was removed. 

So make sure your change GetResponse Event and add:

Symfony\Component\HttpKernel\Event\ResponseEvent