I had depression before I started a keto/carnivore diet. When I started eating less sugar I noticed my mood was elevated. It took me several days to figure out what was going on. After that if I started eating sugar again my mood tanked.
If someone has depression, it very well could be because of their diet. It was mine. Cheers!