Mine does that, Is it an E36 coupe?

I usually just leave the door open, And just push the little microswitch on/off a few times on the striker and it eventually gets to the top and works as normal.