Go into the boot & remove the covering trim on the petrol side of the boot, you should see the cable going to the boot lock. I have the same issue with my then car, BMWE36, It was the locking plastic Latch that went into the Petrol Opening Cover, it wasn't returning far enough. ( A simple fix )
Another thing you could try is disconnecting the battery for about 10 mins and then reconnect the battery. This may reboot the electronics ( your radio may need to have the code put back into it afterwards, so make sure that you have it handy ).