Terence Eden, who's apparently inspiring several posts this week, recently shared a way to attach a hook to WordPress's get_the_post_thumbnail() function in order to remove the extraneous "closing mark" from the (self-closing in HTML)
element.
By default, WordPress outputs e.g.
https://danq.me/2024/07/31/wordpress-htmltidy/