Answer
This is a hands-on demonstration. Try it and see!
The basketball does not quite return to its original height, and the tennis ball rises to higher than its initial height.
Work Step by Step
The decrease in the basketball's PE is balanced by the increase in the tennis ball's PE. There is no violation of the law of conservation of energy.
In fact, some of the initial PE is transformed into sound and thermal energy, so there is even less PE at the end than at the beginning.