If we try to upload first through a teams msg then the result is a fail. If we then goto the share point website then sometimes the same file is uploaded successfuly. If we go back to team and try to upload from files tab then 1 out of 3 times the same file uploads on the balance tries the result is access denied.
However if we try to attach the same file as a msg in the teams the result is nearly always a fail.
So pl try attaching the file thru the user which you have given only uploader access through a teams msg in the relevant team channel document library but through the teams app pl.
The outcome is different every time we try to upload the same file.