Usual issue from those dear Bone pointers in pose data... Note that this is more like minimal-risk, quick fix, it's nothing like 'nice to have' code. Think proper solution would be to refactor handling of those kind of 'caches' to ensure they are valid/up-to-date in a much easier way, at the very least. Ideal solution being to get fully rid of those horrors, of course, but let's not dream here. ;)