Hi Anns,
Thanks for reaching out.
All the attachments shared by user over MS teams chat gets stored in that user's one drive.
However with client credential flow when you access one drive using me endpoint, the user is not identified. so in order to download a user's MS teams attachment you have to replace your endpoint by following so that the user can be identified.
https://graph.microsoft.com/v1.0/user/{userid}/drive/root:/Microsoft Teams Chat Files/{}
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".