Deep near-infrared photometry of the globular cluster 47 Tucanae. Reconciling theory and observations