You want to write a wp_insert_post_empty_content filter.
WordPress will already try and reject empty posts:
$maybe_empty = 'attachment' !== $post_type
&& ! $post_content && ! $post_title && ! $post_excerpt
&& post_type_supports( $post_type, 'editor' )
&& post_type_supports( $post_type, 'title' )
&& post_type_supports( $post_type, 'excerpt' );
but I guess that logic isn’t catching your posts here. So you’ll need to work out what your empty posts look like specifically and catch them too:
function wpse390344_empty_posts_filter( $empty, $postarr ) {
if ( ! $empty ) {
// TODO: look at $postarr - see wp_insert_post() documentation for format
// and decide if this is an empty post you want to reject.
// If it is, return true.
}
return $empty;
}
add_filter( 'wp_insert_post_empty_content', 'wpse390344_empty_posts_filter', 10, 2 );