@malcom: There is no image setting size set to that number. I traced it in wp-includes/embed.php where it explicitly set it to 99999. Check line 682.
wp_get_attachment_image_src( $thumbnail_id, array( $width, 99999 ) );
@bcworkz I traced the problem to wp-includes/embed.php where it uses the correct width but sets height to 99999. Is there a reason for this?
I verified that this was causing the problem because I tried editing wp-include/embed.php:LINE 682 to use $height instead of 99999 and got the image to work.
Any suggestion how to go about overriding this without updating wp-includes/embed.php file?
SOURCE: https://developer.www.ads-software.com/reference/functions/get_oembed_response_data_rich/