You may need a new rim.
If it keeps going out of true, look
for a really rugged rim.
However, wheels are made by robots these days and usually need an adjustment after some riding.
So if it just happens once, it's not something you have to worry about.