A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
Please try to use below PnP PowerShell to apply theme for a SharePoint site.
#Config Variables
$SiteURL = "https://tenant.sharepoint.com/sites/emilytest"
$TemplateXML ="D:\PnP-Theme.xml"
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Interactive
#Apply provisioning Template
Invoke-PnPSiteTemplate -path $TemplateXML
Note: You should run PowerShell as administrator.
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.