The SharePoint Client Object Model and REST API require that you use client Id and certificate when requesting tokens that have application (app only) permissions from Azure AD. If you use a client Id and secret to get a token that has application permissions, the SharePoint Client Object Model and REST API will throw an exception when that token is used with a request.
It's worth noting that the Microsoft Graph doesn't have the same restriction. With Microsoft Graph you can use client Id and secret to get tokens that have application permissions and then use those tokens when making requests to SharePoint.
I'm not sure why CSOM and REST have the restriction and Microsoft Graph does not. It seems a little counterintuitive.