Black beans should be fine once cooked
Feeding them raw isn't a great idea though,but you could definitely mix up some sort of hamster-safe DIY food recipe as a special treat!Perhaps black beans with a bit of rice and maybe another vegetable or add some plain boiled chicken?