Smooth Scroll not working in table of content

I have installed table of content plus plugin to add table of content in my site. It is working very well, except when title have symbols like “&” and “…”. Check this link for example. Tour to Floyd's Pelican Bar - Travel Guide & Tips – 2022

Here when you click duration & cost, it does not smoothly scroll to the section. It can be fixed if i add id in the title like this “duration-038-cost”. However this is not good for SEO

There might be another way to fix it. Wp filter can be used like shown in this link Table of Contents Plus | dublue

function my_custom_anchor( $anchor )
{
return strtoupper( $anchor );
}
add_filter( ‘toc_url_anchor_target’, ‘my_custom_anchor’ );

I am really bad at php, and i cannot figure out how can i use wp filter to remove &/038 from anchor links.