Welcome to our forum!
Looks like the issue is more related to Office development. Please kindly understand that the Outlook tag here we mainly focus on general issues about Outlook desktop client, and little is known about office development.
Based on my search, the official documentation states to extend the Office UI by adding a button to the Office apps ribbon using the add-in command in Office Add-ins. When a user clicks your command button, an action is taken, such as opening a task pane.
References: Automatically open a task pane with a document - Office Add-ins | Microsoft Learn.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.