Get the link for RSS item to display in feed

The the_permalink_rss() is echoing it’s content not returning it.

If we look at the source of this function:
https://developer.wordpress.org/reference/functions/the_permalink_rss/

We can just copy what it’s doing, as it’s a simple function.

$link = esc_url( apply_filters( 'the_permalink_rss', get_permalink() ) );