Continuity mistake: Several episodes have stardates after this episode, but still have Tasha Yar in them (even though she dies in this episode). They aired before this episode. The series producers later formalized their stardate system so that they take place in the order the episodes air.
Continuity mistake: When the away team encounters the evil oily blob thing, it makes their equipment fly away. Later they have apparently recovered it. But strange things keep happening to Geordi's weapon: when he and the others run forward to rescue Riker, Geordi accidentally drops it in the black pool when he stops abruptly. Admittedly, you can't prove that's a mistake even though it has no purpose in the story. But shortly afterwards the phaser is back on Geordi's belt, clean. Did the sticky, malicious, bullying blob give it back just like that? (People often try and find justifications for mistakes, but in this case, wishful thinking can only give us an extremely unlikely explanation.)
Answer: Yes. The doors to the holodecks can be locked when in use by anyone aboard the Enterprise so they couldn't be disturbed. However, high ranking officers like Captain Picard could override the doors as it's seen that overrides are in use even for the crews quarters. Even Barclay, when he's indulging in one of his fantasies could have the doors to the holodeck unlocked by an override code.