Hello. I cannot state the laws in your area, but am sure that if you are in an incorporated city or town, it's unlawful to discharge a firearm in the city/town limits.
I don't know if racoons have a season on them where you live; they do NOT here in Texas.
On the legalities part, you are on your own.
As to the 9mm: I've killed many, many '*****
using the 9mm Browning and it works fine. I would not use ball. I had grand luck with Sierra 115 gr JHPs loaded to about 1300 ft/sec; no exits and very good "stops" when placed through the shoulders or just behind them. You are not talking about one heck of a lot of shooting to get rid of these cute, but often pesky critters. Glasers would do the trick, too and not overpenetrate. Should you not wish to go with handloads or exotics, you might try Triton 115 gr HiVel +P JHPs; they are quite accurate in the 9mms I've fired them from and have cleanly killed javelina for me. Expect about 9" of penetration.
Your 9mm with expanding ammo is up to the job of taking out the pests, but I'd avoid the loads that tend to penetrate quite a bit in the event that a bullet escaped and damaged your property...like the tile around the pool, etc! I don't mention human injury because no one on this board would fire when it was not safe for humans...unless they earned being the recipients by a felonious assault.
I don't know if you've got access to one or not, but I'd likely use an accurate .22 Mag rifle on the "bandits."
Best and good SAFE shooting.