I have tried the requirement you asked for but, the requirement seems to be confusing the tab group layout is designed to have static content. If you are trying to delete or add any tab this must be done at the design level.
If you want the close a tab or open a tab on UI level we suggest you to go for dynamic containers with the tabbed layout.
Also, please elaborate on your requirement why exactly are you looking for closing static tabs ?
My requirement is: I have a tab group in a section say X1 and then X2. Now I am opening a portal and as per our design, the section will load by default(Which contains the tab group). As it is loading as a tab group of section, it is not providing any OOTB cross icon.
I have to implement the similar Pega OOTB cross icons functionality for X2 tab, So that it can be closed on click of the cross icon.
Note: The cross icon has to appear by default when the section is loading, so that it can be click and close the tab.