Cats are hunters and are naturally curious and need some outdoor time. I personally don't think it's good for a cat's mental health to be caged indoors. It may be good for yours however.
Royb's kitty may have been frustrated being cooped up and decided life would be better outside.