Lenders actually like young borrowers. They hope you'll use them beyond your first purchase, for your second home, third home and so on. So it's unlikely that your age was the reason you've "had this happen already".
Perhaps it had more to do with your "average credit"... maybe it was less than average. Maybe you didn't have high enough scores, or make enough money, or have enough savings, or have too much credit debt.... those are common afflictions of the 'young'.
Any good lender should be able to tell you what you need to do in order to be approved for a loan.