It was at the same company. They expect you to discuss posting with your manager before applying. Even if you don't, the application system notifies them automatically when you submit a resume.
In this case the hiring manager called my then current manager to ask what was going on, why I declined (even after I already told him), and basically trying to make me look like I was wasting company time or being rude.
Luckily I got another call later that day offering me a position with a different team, so i didn't have to deal with either of these managers again. Although we are a pay for performance shop, and I feel like the old manager screwed me on my year-end bonus (target is about $7k and I got $1k) and this probably played into that.