No it’s not guaranteed defense lawyers fees. Only if it’s frivolous.
Dismissing a case with no basis in law is one deciding factor on whether the loser has to pay. If the plaintiff's suit is dismissed for lack of standing then that would come under that definition.