FileAPI PDF files upload issues - ClientError: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'Request contains an invalid argument.', 'status': 'INVALID_ARGUMENT'}}

I am encountering a persistent 400 INVALID_ARGUMENT error when attempting to process PDF files larger than 50MB, even when using the File API as recommended. The official documentation states that the File API supports files up to 2GB, but inference fails consistently once the 50MB threshold is crossed.

Expected Behavior: The model should process the file up to the documented 2GB limit, or the documentation should be updated to reflect the 50MB inference constraint for PDF parsing.

Error Log: ClientError: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'Request contains an invalid argument.', 'status': 'INVALID_ARGUMENT'}}

Documentation: https://ai.google.dev/gemini-api/docs/files#usage_info
Code: I just followed what was there in the documentation and replaced the file.

client = genai.Client(api_key=API_KEY)
myfile = client.files.upload(file=local_path)

response = client.models.generate_content(
                model="gemini-3-flash-preview",
                contents=["Summarize this file.", myfile]
                )
print(response.text)

Did anyone face this issue or am I missing something?