Have you tried adding the following to the background.service_worker file?
background.service_worker
chrome.sidePanel .setPanelBehavior({ openPanelOnActionClick: false }) .catch(console.error);