I think it's a bit odd, but offering to go elsewhere, kind of puts this in a weird category since it basically says to the friend the need is not urgent. On the other hand, if the OP had shown up and said I've been caught short I really need to use your bathroom, it would be, in my mind, extremely rude to decline if the facilities were working. Even if the house is a mess, leaving a friend to have an accident on your doorstep to avoid them seeing that your house is a mess is, I think, extremely rude.
If your (generic you) house is so messy that you'd rather a friend have an accident on your doorstep than to clean it enough for them to enter, it seems a good hint that it's time to do something. Alternatively, you should go to extreme lengths to ensure the situation never arises, such as never having them meet you at your home.
If they deny you access, is it rude to say, do you mind if I just go behind the bush there, or can you bring a chamber pot out to me?