Ok. It's his insecurities showing.
Possibly a fear of getting older himself; possibly a feeling of inferiority; possibly a sense of bitterness that you're no longer interested in him; possibly an awareness/realisation that he couldn't attract you (or someone else your age) now; possibly jealousy that he maybe no longer has the choice to blur the lines around his ageing...
Whatever the underlying reason, its a problem within him and nothing to do with you.
What I can tell you is that recognising all of the above will not protect you from it affecting you or how you see yourself.
It won't stop a little voice from popping into your head and questioning if he had a point (even though you know it's him really).
When I was in my late 30s, I became single. I tried a bit of online dating. I set my age limits up to 55 becaiee I wasn't looking for a relationship and was interested in just meeting a wide range of men to have a bit of fun with (so sue me 🤷🏻♀️🤣).
What I learnt was that men in their 50s (especially those who would consider dating someone very much younger) have incredibly fragile egos. You just existing and being so very much younger than them is enough to feel their wrath.
He looks at you and sees so much potential in you for love, for life, for the future and he feels that is passing him by nowadays. Time has sped up for him as he realises the hopes he once had are fading and the fears may well be realising themselves. His window of opportunity is growing ever smaller and yours is unchanged.
The best thing you can do is remove him from your life and carry on being 38 without worrying about what some bloke who is well past his prime thinks of you.