Problem in dependency injection in drupal custom module service
From the looks of the core middleware services, the HTTP kernel is automatically provided to the constructor. You don't have to specify it (and even if you did, @kernel is Drupal's kernel, so might not be what you meant).

As an example, ReverseProxyMiddleware's constructor signature:

public function __construct(HttpKernelInterface $http_kernel, Settings $settings) {


And its services entry:

http_middleware.reverse_proxy:
  class: Drupal\Core\StackMiddleware\ReverseProxyMiddleware
  arguments: ['@settings']
  tags:
    - { name: http_middleware, priority: 300 }


Note no explicit @kernel, yet it's the first constructor argument.

So in theory you just need to change you service definition and clear caches:

class: Drupal\mkt_tracking_v2\Middleware\TrackingMiddleware
  arguments: ['@config.factory','@request_stack']
  tags:
    - {name: http_middleware, priority: 1000}