What you want is to have a number of groupboxes to behave like an accordion. The built-in groupbox is very simple and not capable of that behaviour.
You can write a bit of JS to make the other groupboxes collapse if one is expanded or look if there is something usable in the AppStore.
Or you can make a fake groupbox with conditional visibility and some logic behind it handling which are closed and which are open.
Try Appronto's https://appstore.home.mendix.com/link/app/2029/Appronto/UXManipulator to add extra events to the open/close accordion buttons. That way you can use this widget to close other accordions when the button open is triggered for a specific accordion.