If str_contains does not exist, str_contains defined in wp-includes/compat.php line.493 will be used, so I think there will be no error, but an error may occur if you are using WP5.8 or earlier.
In any case, I think it is better to keep PHP and WP relatively new, even if not the latest version, so in the next update, I plan to change the minimum version of WP to 6.0 or higher.