TPNOSTATSHARE, VIEW "[NO]STATSHARE" is not allowed inside a TP transaction
Run Time Error: Because statistics sharing is a non-ACID (due to not being Isolated) action GT.M does that permit changing it within a TP transaction.
Action: Move any switching of statistics outside of any TP transaction.