Collisions of ultracold molecules in bright and dark optical dipole traps