Create Database Table in Run Time
You're passing the wrong thing as the schema definition.

This is what you need:

$schema['myid_template_'. $template_id] = array(...);

db_create_table('myid_template_' . $template_id, $schema['myid_template_'. $template_id);