I usually demo on a test instance, which is the exact copy of the production one. I do test the thing I demo for a few times. This means most of the time everything goes smooth.
Then, there are times when The Demo Effect™ kicks in. Unless it is something serious, my usual reaction is “can we postpone this demo by 10 minutes? Something is strange here…”