Why is hook_forms form callback not reached? In my custom_apps.module file I'm trying to implement the same form multiple times with different ID's and for that in a loop I call for:

drupal_render(drupal_get_form('driver_route_'.$delivery_nid, $args));


I have a hook_forms function:

function custom_apps_forms ($form_id, $args) {
    // If driver route form
    if (0 == strpos($form_id, 'driver_route_')) {
        // Call one of the multiple forms
        $forms = array();
        return $forms[$form_id] = array(
            'callback' =&gt; 'driver_route_form',
            'callback arguments' =&gt; array($form_id, $args),
        );
    }
    return array();
}


And the driver_route_form() function itself:

function driver_route_form(&amp;$form_state, $form_id, $args) {...}


However for some reason the driver_route_form never gets called and instead I get this notices/warnings:

Notice: Undefined index: driver_route_55 in drupal_retrieve_form() (line 806 of /var/www/website/public_html/includes/form.inc).
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'driver_route_55' not found or invalid function name in drupal_retrieve_form() (line 841 of /var/www/website/public_html/includes/form.inc).


It seems as if it's still trying to look for a function with the form_id not the one defined in my callback. What could be the casue of this? I have made sure the inside of custom_apps_form where the form is returned is reached.
Instead of:

return $forms[$form_id] = array(
            'callback' =&gt; 'driver_route_form',
            'callback arguments' =&gt; array($form_id, $args),
        );


You should have:

$forms[$form_id] = array(
            'callback' =&gt; 'driver_route_form',
            'callback arguments' =&gt; array($form_id, $args),
        );
return $forms;