Block not showing input fields
try to follow best practises:
as no need to render anything on your get the twig template as drupal core handles this. 

module structure:

mymodule


mymodule.module
mymodule.info.yml
mymodule.libraries.yml
templates (dir)
-- templates/accesscode.html.twig
src (dir) 
-- src/Plugin/Block
----- AccessCode.php


in mymodule.module

/**
 * Implements hook_theme().
 */
function mymodule_theme($existing, $type, $theme, $path) {
    return [
      'accesscode_block' =&gt; [
        'variables' =&gt; [
          'test' =&gt; null,
         ],
         'template' =&gt; 'accesscode', 
//no need for full accesscode.html.twig as drupal knows. 
      ],
    ];
} 


then in your src/Plugin/Block/  AccessCode.php

 /**
 * {@inheritdoc}
 */
public function build() {
  $build = [];
  $build['my-block'] = [
      '#theme' =&gt; 'accesscode_block',
      '#test' =&gt; 1234,
  ];
  // Attach js or css easier. 
  $build['#attached']['library'][] = 'mymodule/mymodule-accesscode';

// Could even add a form element like ..
 $build['some_field'] = [
   '#type' =&gt; 'textfield',
   '#title' =&gt; 'My Field:',
 ];
  return $build;
}


then in your accesscode.html.twig you can use the twig var {{test}}