Is it a oem BMW part or is the light unit and seal an ebay supplied copy?
On the Z3 the fitting is very tight to reinstall to get a good seal, been through this a couple of times on my Z4 using ebay units, the seals vary from supplier to supplier, last one I had to change due to failed led's came with a better seal than the previous one I had fitted.
The Z3 unit seems harder to fit than the Z4 last resort would be to use some black silican sealant to seal any gaps, not ideal but might solve the issue.