Rear wheel touch frame during off saddle sprint
Possible causes may include:

a. The tyres are too wide for the frame, check the clearance between the tyre and the stay. Be aware that there are dynamic shape changes under load.

b. The wheel is too soft. Does it suit your weight? Are the spokes properly tensioned, even though the wheel is true?

c. The rear triangle and/or the bottom bracket housing are too soft and move sideways. This is the case on certain frames. It happens with powerful riders who may put a high load on pedals especially off saddle. You research on cycling magazine sites who tested the bike. To check the sideways flex: Stand over the bike, put the left foot on the pedal, lean the top tube against the right leg, pull both brakes and push the foot down hard. You'l see how far the BB moves to the right.

d. The wheel axle has play. You can check this if you lift the rear wheel or, better, put the bike on a stand and try to wiggle the wheel sideways.

I'd say that the most likely cause is 'c', combined maybe with 'a'.

[edited]