The pager on a form doesn't update upon first submit of the form
Seemingly, I have fould the solution.
Namely, to avoid it, I set the Element property for the pager explicitely.

Here are fragments of code.

$nodes = $q-&gt;sort('created', 'DESC')-&gt;pager(10, 0)-&gt;execute();

/// code here

$form['nodes_container']['pager'] = [
  '#type' =&gt; 'pager',
  '#element' =&gt; 0,
  '#parameters' =&gt; $pager_params,
];


Unfortunately, I didn't have a time to debug and find out why it didn't worked before but it works now. Newertheless, it works.