Please run this process in debug mode and capture the detailed error from there.
Then share that with us, there can be multiple sub reasons for this error like you don’t have required api permissions etc.
Please verify if you have necessary graph api permissions enabled for this app I’d.
Also, confirm the version you are using for O365 package.
Regards
Sonali