Ge the value of id in master table and supply it to other tables
Assuming the ID in the master table is generated (e.g. because it's defined as generated always as identity or serial) you can do those inserts in a single statement:

with new_master as (
  insert into master_table (column_one, column_two, column_tree
  values (1,2,3)
  returning id --&lt;&lt; makes the generated ID available
), new_t1 as (
  insert into table_01 (master_id, some_column, other_column)
  select id, 'some_value', 'other_value'  
  from new_master
), new_t2 as (
  ... as as above
)
insert into table_04 (master_id, some_column)
select id, 'another_value'
from new_master;


You don't really need a stored procedure for that, but you can put the above statement into one if you really want.