BEANS do NOT like the onion family which includes onions, shallots, scallions, leeks and garlic. These vegetables inhibit the growth of beans.
There are some vegetables that don’t grow well together. Now when I garden in my raised beds, I tend to plant something new as I harvest something else. Sometimes I am just too busy with life and forget about what not to plant next to each other. This is important. There are lots of charts that are available online that discuss good and bad companions. I think it is more important to worry about the bad companions first.
I can’t comment on leeks because I didn’t grow any.  In one narrow bed, I grew a row of garlic, a row of shallots, a row of beans and then a row of strawberries. What is interesting is that the beans did OK but not great. While beans don’t like the onion family because they inhibit their growth, they do like strawberries as companions.
In another bed, I planted a couple row of onions which grew really well but the calypso beans that I planted next door did terrible. I have just enough beans to taste them but I don’t have enough to share with a family of four!
The rest of my beans that I intermingled with other vegetables did really well.