Hi,
Please take a look at the function render_block() under the function set_block_data(),
private function render_block( $attributes = [], $is_preview = false, $post_id = null ) {
$this->enqueue_block_assests();
if ( $this->render_callback ) {
call_user_func( $this->render_callback, $attributes, $is_preview, $post_id );
return;
}
if ( file_exists( $this->render_template ) ) {
include $this->render_template;
} else {
locate_template( $this->render_template, true );
}
}
if the callback is available, it will run the callback and end the function before call the template so it is impossible to run a template inside the callback. But thanks for the idea, I will discuss with the developer team to support this case.