better like this:
//* remove and replace parent theme actions
function remove_actions_parent_theme() {
remove_action('wp_head','flatsome_viewport_meta', 1);
}
add_action('init','remove_actions_parent_theme');
//* Now re-add the customised action
function child_viewport_meta_replacing_parent_theme() {
echo apply_filters( 'child_viewport_meta_replacing_parent_theme', '<meta name="viewport" content="width=device-width, initial-scale=1" />' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
add_action( 'wp_head', 'child_viewport_meta_replacing_parent_theme', 1 );