Some fruits also taste sour when they are immature, because at this time their seeds are not yet ripe and they do not want to be eaten by animals at this time.
However, it is true that some fruits still have a sour taste when ripe, but fruits like lemons, which are very sour from beginning to end, are not common.