Any time that different materials are joined together, there is a small potential for failure. I emphasize that if the manufacturer knows what they’re doing, the probability is small. However, if I understand the OP correctly, they may be one of the unlucky few.
The arrow in the photo on the original question seems to point to an aluminum structure that contains the clamping mechanism. Most likely, this structure was bonded (I.e. attached with industrial strength glue) to the rest of the carbon seatpost. Other methods of construction exist for carbon posts that don’t rely on that large an aluminum structure being bonded to a carbon tube. However, carbon to metal bonds or metal to different metal bonds are pretty commonplace. For example, many current generation cranksets have a steel or aluminum spindle bonded to aluminum or carbon crankarms. Carbon frames sometimes have aluminum bottom bracket inserts bonded to them. The list could probably go on, and I’m not a bike engineer (or any sort of engineer), so I’ve probably left a few off.
Nevertheless, if I understood the question correctly, the OP probably has a seatpost where an aluminum insert has un-bonded from a carbon tube. This was probably glued together. However, it’s almost surely not with glue you can just buy from Home Depot, Lowes, or another home repair store. This would be a warranty issue. If the OP isn’t the original owner, they should just buy another seatpost. To emphasize, the aluminum part was originally bonded with industrial-strength glue. Not consumer-strength glue. Remember that the person sitting on top almost always has at least 100lbs (45kg) of weight, plus this is a mountain bike that is being operated on rough terrain. The glue needs to be very, very strong. This is almost surely beyond the average consumer’s capability to repair. If any bicycle engineers want to correct me, please do so.