If you scanned the eSIM QR code with your phone's camera and didn't follow the next steps, the eSIM may have been already installed on your device. Thus the QR code cannot be activated another time and you get "This code is no longer valid" error.
To confirm that your eSIM is already installed, you can check that under the device settings.
For iPhones: Go to Settings > Cellular (or Mobile Data) > Under Cellular Plans (or SIMs), check if there is a second line added below your Primary line. Such line would be the installed travel eSIM.