Don't ever judge a Chimpanzee by the way it behaves while stuck in a cage, especially if it has never been locked up in a cage, in the past. (You may, however, arrive at a few thoughtful conclusions about its nature when you study it in its natural habitat).
The poor creature will need to be locked up in a cage regularly and frequently enough for there to be a reliable pattern in its behavior. If it is true that apes learn from mistakes, then there could be an improvement over a period of time. Only if the Chimp is conscious of its behavior and desires to change it. What this implies is that you may end up changing its natural behavior when you subject it continuously to an alien environment.