Hi @C4DS I tracked it down a bit.
First of all this issue appears only if you are in BodyaPaint Layout mode.
The main problem is that in R21 and previous versions, there is 2 tool logics (For BodyPaint and for Classic one) and more problematic, 2 different attribute manager, while in S22 there is only 1 attribute manager.
The issue in R21 is that if there is no Mode selected, and you are in BP mode, SetAction assume that you want to define the BodyPaint Manager and command, so if you define previously the mode to a Polygon mode it will set is to the one you expect.
doc->SetMode(Mpoints);
doc->SetAction(ID_MODELING_ROTATE);
SyncMessage(EVMSG_TOOLCHANGED, ID_MODELING_ROTATE);
Defining the Mode to a modeling mode and make sure to also send EVMSG_TOOLCHANGED this way the internal state of command manager for BP will also be updated(otherwise you may see the command jump).
Cheers,
Maxime.