I started writing a novel that I thought was originally going to start out as MG, so my main character is eleven. It turns out that there is a fair amount of swearing and heavier topics in the book. Would it be YA because of it, despite the age of my main character, or should I continue calling it an MG?
Generally YA is for readers in their teens and up. The general consensus is young readers read UP in age: eleven year olds read about 13-year-olds; 15 year olds read about seniors in high school. I think that's right based on what I hear and what I read when I was a sharkling.
So, the question isn't can you call it MG with grown up themes, and swearing, it's whether anyone buying books for a nine-year-old is going to buy a book with swearing. I think heavier topics, when handled deftly, will be fine, but honestly hearing a young kid say motherfucker has never ceased to stop me in my tracks.
And books for MG are a tricky sell: lots of librarians, lots of parents, lots of school fairs. Maybe kids are online buying books themselves these days, but I think that's a pretty small proportion of the buying population.
This is where the good folks who belong to SCBWI come in. They offer conferences and conventions and they're filled with people who know this category like the back of their hand. Find them. Go meet them. Ask.