I had an enquiry where a potential client has taken money from their SMSF before retirement - they had intended to make a property investment with the SMSF, but ended up purchasing the property in their own name.
I knew the consequences were likely to be quite serious.
But luckily I found from other accountants who have been in similar situations - if you engage early with the ATO - they may just require that you pay the money back with interest, then roll the funds into a non-SMSF (i.e. a retail or industry fund), then agree not to be part of an SMSF again.
Examples:
How we help you if you engage early.
SMSF support services (for SMSF professionals like us:)