If a service account gets empty results from the Team Drives list, the missing piece is usually Admin-side, not code: the service account email must be added as a member of the Team Drive in the Admin console, with sharing enabled for Drive and Docs.

Context: Stack Overflow #43243865 (accepted answer, 14 votes): the asker's service account could not see a Team Drive at all, even with Drive API access enabled. The accepted answer walks through the Admin-side setup that fixes it: turn sharing on under Apps, Google Workspace, Drive and Docs, Sharing settings, open the Team Drive in Manage Team Drives, and add the service account email as a member with the needed access level. Only then does the service account's Team Drives list return the drive.