Create folder if it does not exist in sharepoint using Ms 365 scope

Find Files and Folders gives you an array of items. Create Folder takes just one folder. The error message is pretty clear. You’re giving it an array of DriveItem when it needs just a single DriveItem.