No expeience with Beretta here. But on my FNS9/40 and Ruger P-89/P91, 40SW mags work with 9mm ammo and vice versa. However, you may notice, as I have, that 9mm cartridges in 40SW mags are barely held in place by the mag lips, dangerously close to slipping out. Therefore 9mm cartridges are tilted up and may cause feeding problems in an inopportune moment.
40SW cartridges are held very securely, obviously, in 9mm mags.
Hence, as Ebola said above, I will not trust my life to 40SW mags with 9mm cartridges. Range use, yes, I do it all the time. I dire situations, like losing all my 9mm mags, I have peace of mind that they will work interchangeably well enough.