This is true in my experience. Also in my experience there were consequences that weren't illegal but kinda sucked.
Correct. The landlord may have the legal right to enter, but a tenant has a legal right to refuse. The landlord cannot enforce the law. Only a court (or in rare instances the cops when it comes to landlord/tenant issues) has the right to determine if the landlord's legal right to enter supersedes the tenant's legal right to refuse entry. If a landlord forces the issue, there are other laws being broken and landlords have been hauled to jail for doing this.
Once I have a court order saying I can go in? I can go in. Then it's the courts enforcing my legal right to enter.
And the other consequences can suck, yes. Like, if you refuse me the right to enter to make a necessary repair, and I get that right in court, and then I go in and more damage was done due to your refusal, you are responsible for those extra costs, not me.
(Side note: my previous tenant, who is an agency and did not enforce their right to enter and inspect, now owes me like $2000 for damages I had to repair when their last client moved out. Thank goodness I can get that money back! And I didn't even charge them for everything I could have charged trying to be nice.)