It's probably sun shocked. It looks etiolated (stretched) due to low light (see how the stem is narrow near the top?) and probably couldn't deal with so much outdoor sun all at once. Try putting it in bright shade or filtered light and then gradually increasing the sun over a period of weeks. That plant is not a cactus, by the way, it is a Euphorbia. Also succulent, but not from the Americas.