As I was researching I found a few mixed views but mostly the claim is true! It depends on the person and their individual hormones but overall it works for most individuals. Bananas are a great source of fiber and minerals which help reduce pain in period cramps. As I was researching I found an article from Flo health. I use their app to track my periods and know it is reliable. They said, " They are rich in fiber and will help you have easy bowel movements. As a result, you may feel less bloated and experience less pain overall. Bananas also contain a lot of magnesium, which is known to reduce the severity of period cramps". I then did an even deeper dive into who wrote the Flo article and it was written by Andrei Marhol who has written a few articles published in the Journal of the Grodno State Medical University. An article from health.com said, "A medium banana has over 400 milligrams (mg) of potassium. Bananas contain other electrolytes to help you reduce your risk of muscle cramps, including sodium, magnesium, and calcium. Bananas are also a great source of fiber, healthy plant compounds, and vitamins like A, B6, and C". Health.com agreed with Flo and mentioned that the electrolytes are also beneficial. Although it might not work for every women, bananas seem like a good way to reduce period cramps.
https://www.health.com/foods-that-prevent-muscle-cramps-7973949
https://flo.health/menstrual-cycle/health/cramps/foods-for-cramps-relief