This is not asked in the question. Maybe it could also help, I had to pass a parameter to a form that was not loaded by a route. The form is integrated into a template loaded by a controller.

    path: '/lorem/{arg}'
    defaults:
        _controller: '\Drupal\my_module\Controller\LoremController::testLorem'

In the controller, the form is called and the parameter `$arg` is passed to the form builder.

    public function testLorem($arg) {
        $form = \Drupal::formBuilder()->getForm('Drupal\my_module\Form\testForm', $arg);
    }

And in the form :

    public function buildForm(array $form, FormStateInterface   $form_state, arg = null) {
    }