Please include test files for easily reproducing the bug in future reports.
Here's a sample file showing the bug and providing enough info to quickly reproduce it:
At this stage, I'm not sure what exactly is causing this. My first guess is that it might be one of those Euler Rotation Order problems, which should be able to be fixed by choosing another rotation order.
Ok, I've found and fixed the issue now. See the commit log (coming later, after I wrap up some other WIP stuff I'm going) for details about the fix.
Here's an edited version of the above test file which should work once the fix is in place: