I have well over 1,000 applications I tracked over the years I've worked in the industry. (Started keeping track in 2014) I've interviewed at hundreds of places. I don't think I've ever interviewed at less than 50 places before getting a reasonable job offer. I have to study leetcode and system design religiously (I've solved over a thousand over the years) before I even apply for one job.
You're telling me you applied for 40 jobs and gave up? Maybe this industry isn't for you then. Have fun in retirement.