There's no issue with XP.

This particular PIP script works by (1) making a hole in the big window and (2) putting the little window in the exact same spot as the hole.

The screenshot shows that you're putting the hole and window in different places. That's the cause of the problem.

There are two ways to solve the problem. You can either use the same numbers for the hole and little window so they'll be in the same spot. Or else you can stop making the hole (remove SetWinRegion from the script) and instead, use AlwaysOnTop to keep the little window on top of the big one.