WD-40 is supposed to be the be all and end all of thread looseners. It wasn't created for that purpose. It was created as a water dispersant to remove moisture from NASA rockets. Hence the WD part of the name. The -40 arises from the fact that it was the fortieth mixture brewed up by the developers to do the job.
There are plenty of other penetrants that do a better job. These range from the DIY 50/50 acetone/transmission fluid to stuff like Kroil and Mouse Milk. I've even seen stuck engine pistons freed by pouring in some kerosene and giving the top of the piston a bit of a tap with a hammer handle over a few days. Obviously in that sort of case, time is not a factor in the repair.
I watch a lot of videos where people use WD-40 to free rust-seized nuts, bolts or screws. I often notice that as the threaded section of the fastener is exposed, it is not wet very far down the shaft. I reckon most of that is sprayed on just floods over the surrounding surfaces. Any proprietory penetrant is expensive - mostly in the cost of packaging and retailing. My preference is acetone and ATF.