How to pass same contextual arguments to two view blocks programmatically?
While rendering a view you can only use on display.
So it is only possible to loop through your display array and generate the view within that loop like:

          else {
              foreach (['block_1','block_7'] as $display) {
                $view-&gt;setDisplay($display);
                $view-&gt;setArguments([$term-&gt;tid]);
                // You need to render here.
                // The loop will overwrite the first display.
              }
            }