Adding and removing dom content does not itself cause layout shifts. And, after users interact with the page (for example, to dismiss the popup), any shifts that happen within 500ms will be ignored from CLS. But, the easiest way to know for sure is to just test the page and see!
If you use a
lab tool like lighthouse / web page test / page speed insights, you will only automate and measure the loading portion of CLS without user interactions, so you won't know if the popup dismissal leads to layout shifts. I think the best way to test CLS is to interact with the page and see what CLS is reported yourself. You can use the
Web Vitals Chrome Extension, or, try to use the
Measure using JavaScript, perhaps just from the DevTools console.