for anyone with this problem theese functions seems to work pretty well
// render meta block with provided data
function rwmb_meta_render_block($id, $data, $className = null, $echo = true) {
$block = [
"blockName" => "meta-box/" . $id,
"attrs" => [
"id" => "mb-block-" . wp_hash(microtime()),
"data" => $data,
"className" => $className,
],
"innerBlocks" => [],
"innerHtml" => "",
"innerContent" => [],
];
$html = render_block($block);
if ($echo) {
echo $html;
}
return $html;
}
// render reusable block
function rwmb_meta_render_reusable($block_name, $echo = true) {
global $wpdb;
$html = "";
$block_id = $wpdb->get_var("SELECT ID from {$wpdb->posts} WHERE post_type='wp_block' AND post_name='{$block_name}'");
if ($block_id) {
$attributes = [
"ref" => $block_id,
];
$html = render_block_core_block($attributes);
if ($echo) {
echo $html;
}
}
return $html;
}