Engine hits wall at 5k only in 3rd gear

Even if they are working fine in 1st and 2nd?
that is the X factor but when I had that problem it was very unpredictable and it would just fall on its face