Default excerpt for parent of a custom post type

This will default the excerpt value in your custom post type only for new posts:

add_filter( 'default_excerpt', 'smyles_default_custom_post_excerpt', 10, 2 );

/**
 * Default Excerpt for Custom Post Type
 *
 * @param string  $post_excerpt Default post excerpt.
 * @param WP_Post $post         Post object.
 *
 * @return string
 *
 */
function smyles_default_custom_post_excerpt( $post_excerpt, $post ){
    
    if( $post && $post->post_type === 'mycustomposttype' && ! $post->post_parent ){
        return '[mycustomshortcode]';
    }
    
    return $post_excerpt;
}

The check for $post->post_parent checks the parent, if it is a “child” post, the value will be different than 0 which means it’s the parent post