Confluence Cloud doesn’t allow nested rich text macros. However, Atlassian is planning to introduce a new feature that they refer to as “Referentiality”, basically meaning that they assign a macro an identifier that you can refer to from within your macro:
However, it’s still under development, so I think there is no way to do what you’re looking to do at the moment Confluence Cloud just doesn’t support nested rich text macros anymore.