Expandable card not hiding previous navbar

I have an issue where when the expandable card is open, I have a close button in the top right hand corner. However, when that button is clicked, it is actually clicking a button that is on the previous sub navbar.

Home -> page with subnavbar -> details page with expandable card.

As the card is opened, the navbar on the details page hides as desired, which is great. However, although not visible, the subnavbar from the previous page is there and clickable which inturn prevents me from being able to click the close button as the hidden button on the subnavbar is being clicked.

Would be good to see live example using template from here How to ask a good question on forum