Anchor to a section sitting inside a div not working

I have a button that link takes the user back to a specific section on the homepage. I assign an ID to the section, and the button link to external link like this: mywebsite/#section-id

This method works until I wanted to add a smooth scroll animation to my site, so I wrap all the sections in a div and give it and ID which will then respond to the custom code I added.

After I wrapped all the sections in the div, my anchor no longer works. I guess this is because anchoring to a section only works if it is on layer 1 (not sitting inside a div)?

I would love to know if there is a way to resolve this, thanks in advance for your help.

Same issue, I’ve not seen any solution to this as of now, IDK if it’s the Section set to a certain value (Relative, static or whatever…) but I’m also presenting this issue…