Am I correct to say the Raptor engine has only flown twice, once on the hopper and once on SN5

Raptors have flown now three times, but that's a bit misleading.

What's important isn't how many times they have lifted vehicles off the ground, but how many times and for how long they have fired. That they have done literally hundreds of times.

For every 'hop' there were two or three 'static fire' tests. The vehicle was clamped or welded to the ground then the engines fired enough for the complete flight and at the full operational thrust.

If anything breaks, you'd rather have it break on the ground than a couple hundred or a couple thousand feet (or meters) up in the air.