Solved with the following change:
fileAttachment.Load().Wait();
if (fileAttachment.Content != null && fileAttachment.Content.Length > 0)
{
string filePath = Path.Combine(directoryPath, fileAttachment.Name);
File.WriteAllBytes(filePath, fileAttachment.Content);
Console.WriteLine($"Attachment saved to: {filePath}");
}