debug-on-error, and more generally the debugger, are not available for errors raised from
post-command-hook (for example, to prevent runaway recursion).
What you can do is what programmers have done from Day One: print information. But before you do that, bisect the list of functions that you have on
post-command-hook, narrowing the problem down to determine the function (probably only one) that is causing the problem.
Then place calls to function
message at various places in that function's code (e.g. use a copy of the function definition). Use
message to print info about the code path executed, and also various state information - e.g., the value of relevant variables.
*Messages* in a separate frame (
C-x 5 b), and place the cursor at the end of the buffer, so you can see what's going on. Then do what you do normally, which provokes the problem. You should be able to see, in
*Messages*, what is going on.
Pretty much anything the debugger could tell you you can see using this method, anyway.