Recession-proofness isn't as much about your role and more about which companies you target.
Bullshit startups ("Uber for dog-walking" or AI-powered dog food for example) are not sustainable to begin with and only existed because of operating on essentially infinite "credit lines" from VCs. These companies will be the first to go during a recession and we're already seeing it with Bird for example.
The companies you need to target are the ones that solve a real problem or demand (and not one manufactured by themselves) - let's take roads for example. Recession or not, the roads are needed and will remain used by pretty much everyone (whether it's shipping, delivering food into supermarkets, etc) so there will always be business opportunities there. Same with energy, water, sewage, etc.
Look for "boring" companies and work with (or learn) "boring" tech. If your entire career is based around whatever Javascript framework is considered "hip" that day then you'll have trouble because these companies are too busy delivering real value using whatever "boring" framework they are using.