Well, yes. But actually no.
If we examine your example with "doing squats with your feet glued to the ceiling", we'll find that there's a set of joints that are closing. Namely the hip and the knee.
In order to forcibly close these joints, we engage the hip flexor and hamstring respectively.
So what is the more realistic version of this? Well, hanging knee raise is essentially a "backward squat", where you're closing the hip against gravity, rather than opening it. However, this doesn't do anything for the hamstring, since there is no force trying to open the knee joint.
A combination of knee raises, and leg curls will "mimic" the reverse squat, but I can't think of a single exercise that flexes both these joints at the same time. Gravity boots may be the only way to achieve it, but even then, it seems like an awful coordination exercise.