This sounds like a glitch to me, cuz the Darmanitan came out of zen mode when I gave it the rarecandybar. Firstly, the question of "did you catch a Darmanitan in the desert resort?" arises, as commented by DT~Valet. The only Darmanitan you can get without using Dream World (DW) is at the Desert Resort. Also the question of "did you catch the Darmanitan in zen mode?" It will stay in zen mode until it is healed in battle, something to that matter anyway. If so, that'll probably why your having this problem.
My easy solution is when this Darmanitan gets to half heath or less, heal it (in a battle), as (formerly) commented by alias. If this doesn't work it is definitely a glitch and put Darmatitan way (PC).