Batch API times out when running a single operation
In BulkPrintForm::submitForm() you invoke batchFunction method by calling it directly via $this-&gt;batchFunction($nid) line. This will effectively skip the batch API and run it for all nodes. You should pass the callback instead, check http://cgit.drupalcode.org/examples/tree/batch_example/src/Form/BatchExampleForm.php#n93