Multiple forms in same page from single form builder returning the first form's value in submit
You'll need to implement hook_forms(), so that you can create 'aliases' of your forms.

For example, let's imagine a form named 'message_form', that you want to include multiple times on the page. To do this, you append a unique number to the form name each time when calling the form:

$page = [
  'form_1' =&gt; drupal_get_form('message_form-1'),
  'form_2' =&gt; drupal_get_form('message_form-2'),
];

return $page;


Next, you implement hook_forms() to watch for form names in the format above:

function hook_forms($form_id, $args) {
  // Act on form IDs that match the pattern message_form-[NUMBER].
  if (preg_match('/^message_form-\d+$/', $form_id)) {
    // The key is the form ID that has been passed.
    $forms[$form_id] = [
      // The callback is the actual form definition to be called.
      'callback' =&gt; 'message_form',
    ];
  }
}


Now each form being put on the page will have a custom form ID and therefore the system will know which form the submitted data refers to.