If you wish to style the site scrollbar, you shouldn’t do it neither through page code (it’s impossible) nor through a custom element (it’s not the best way).
You should do it through Website Dashboard > Settings > Custom Code
And use CSS only with no JavaScript (put it in the head, wrap the css in a tag and apply to all pages).
And read this article about styling scrollbars:
P.S.
I can see you tried ‘overflow-y: hidden’, but this way you won’t be able to scroll down at all, even if there’s some content at the bottom of the document. It is not a good idea (if you have content there, the user should be able to scroll and see it). If you want to style the scrollbar - style it and do not prevent scrolling.