When “#panels:has(ytd-ads-engagement-panel-content-renderer)” is present in “addCSSHideAds”, chapters do not appear on the right side when the “Show Chapters” menu button is pressed. If I comment that out, the chapters will appear when I press the “Show Chapters” menu button as they did in the original version.
I don't understand your problem clearly. So I temporarily commented out that line of code. It's just CSS to hide ads rarely encountered so it's ok to disable it.
When “#panels:has(ytd-ads-engagement-panel-content-renderer)” is present in “addCSSHideAds”, chapters do not appear on the right side when the “Show Chapters” menu button is pressed.
If I comment that out, the chapters will appear when I press the “Show Chapters” menu button as they did in the original version.