Get-MgUserPhotoContent returns zero-length file

Hello and welcome to the forum.
Please remember when you’re posting any kind of code to use the Preformatted Text option to properly format your code:
Guide to Posting Code

Just for clarification, you’re running the line as you shared correct? Suppressing errors? Are there any errors that occur when the output file results in a 0-byte file?
I see running a loop against all my team members that while it successfully downloads the photo for each one (over multiple attempts) it generates an error each time

Get-MgUserPhotoContent_Get:
Line |
   3 |  Get-MgUserPhotoContent -UserId $user -OutFile $file
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot set percent because PercentComplete cannot be greater than 100. (Parameter 'value')
Actual value was 2147483647.

Regardless this doesn’t seem to create an issue.

Can you share some more details about when this fails on your end?