Yeah I am pretty sure CM Punk knew the plan for WM31 was for Roman Reigns to headline it.
I am guessing Punk knew he wasn't going to main event WMXXX either and that Batista getting the main event slot probably compounded with his frustration.
I mean I can understand Punk getting frustrated he was Champion for over a year but his run was seen as an afterthought. He wasn't given a strong program at WM28 (heck his match wasn't even in the opening video) and he even had one his matches pushed out of the closing match at a PPV in favor of John Laurinaitis.
Also I can't say he's wrong either in deserving to close WM. In a company where Kevin Nash, Edge, Yokozuna, Bam Bam Bigelow, King Kong Bundy and Chris Jericho all closed WM he probably felt he deserved it.
From everything I have read, Batista returning and getting to headline ManiaXXX was the final straw for Punk. He knew he had a huge role in the Rumble, thus why he left immediately after the event so he didnt miss the payoff. Ironically, if he hadnt left, Bryan doesnt get the match/Mania 30 that he got. Punk vs HHH hardly a main event match and Punk knew it would suck, much like when HHH got the win in 2011 that defied all booking logic and storylines at the time.