Hi,
just encountered the same issue and the following fixed it:
When building the file attachment object in your code set the odatatype member to "#microsoft.graph.fileAttachment".
In Java it looks something like:
FileAttachment attachment = new FileAttachment();
attachment.name = "attachment.txt";
attachment.contentType = "text/plain";
attachment.contentBytes = Base64.getDecoder().decode("SGVsbG8gV29ybGQh");
attachment.oDataType = "#microsoft.graph.fileAttachment";
The Java code examples in the documentation [https://learn.microsoft.com/en-us/graph/api/user-sendmail] are missing that detail.