Modals not working on mobile in certain chapters

Hi everyone, I’m working on a website that has several modals, which pop up when you click on the header logo (LHS) or on certain elements of the website. I used the example from Sabanna here as my base.

My issue is that on certain pages of my website, the modals don’t show up but the body can no longer scroll. What might be causing this issue, and how do I fix it? Please see examples below to be viewed on mobile (safari/chrome).

Modal doesn’t work on mobile.
Modal works on mobile

@sabanna Thank you again for the detailed example. However, I’m not sure what I copied wrong from it such that the modal no longer works on mobile in some cases but the code still works. Any advice?