This could be a number of things.
Have you done a battery pull to reset the phone?
Are you running an app from the market when it happens?
Have you tried doing a factory reset?
has anyone experienced a random sleep/screen lock even while in the middle of a process? its not like its after inactivity. happens alot when im attempting to take a picture, the screen goes black and its locked itself. it will do it several times in a row, about as soon as I can get it unlocked, it goes black again... any help?