This happen because the machine kinematics overlap the postprocessor kinematics and axis limits.
To fix this issue you have 2 ways.
First: add the lines below in the PB_CMD_before_motion
Second: Edit the PB_CMD_revise_new_iks and uncoment the 2 lines below.
I hope it helps.
The both codes are correct.
But, if you dont't like the machine kinematics overlap the post kinematics and axis limits you need use one of the solutions above.
If your machine have a orthogonal rotary planes, the both solutions are valid, but if your machine have a non-orthogonal rotary planes, only the first solution are valid.
I hope its help.