Under unsportsmanlike conduct fouls we have:
(d) continuing to play after a foul has been called or play has been suspended;
and under continuing play into the next rack, we have:
When fourteen balls from a rack have been legally pocketed, play is suspended until the balls are re-racked.
... so, it is unsportsmanlike conduct to shoot while the balls are being racked.
A place where this could come up is when the player leaves himself a straight-in along head rail for his break shot. After cursing his luck briefly, he calls safe before the ref finishes the rack, and shoots a stop shot, figuring the ball needs to be racked anyway so he is helping the ref to walk less. That puts the ref in a difficult position to figure out an appropriate penalty.