Part of it probably depends on what beans. I eat a lot of chickpeas and I think they’re a harder bean and less likely to get mushy. The other one is black beans and definitely they would be easier to overcook. Did you do the quick release? If not, next time quick release then immediately drain them and give them a quick rinse in cold water. I’m just using the bean setting on my instant pot so if that’s what you’re doing and it’s still mushy with the quick release, figure out how long that cooks for and drop it by a minute or two.