I did some research and my guess this link bellow from Linnea explains everything:
https://www.linsoftware.com/wordpress-has_post_thumbnail-not-working-fix-phantom-featured-image-issue/
“The typical way to check for whether a WordPress post has a featured image is to use the function has_post_thumbnail() This function calls get_post_thumbnail_id(), which queries the database for the post meta field _thumbnail_id.
If the field _thumbnail_id is not empty, has_post_thumbnail() will return true.
has_post_thumbnail() does not actually check to see whether _thumbnail_id is an actual ID of an object that exists in your database. So, on the rare occasion, has_post_thumbnail() will return true when the post thumbnail does not actually exist.”
For me, using the function wp_get_attachment_url instead of has_post_thumbnail() and checking the result if is not empty worked as desirable:
$featured_image_url = wp_get_attachment_url( get_post_thumbnail_id( get_the_ID() ) );
if ( ! empty( $featured_image_url ) ) {
// do a bunch of stuff
}