You aren't allowed in the basement, and the entrance guard explicitly states where you're allowed to go before he lets you in. There are two people in the basement: the cook and the worker, but the worker sometimes goes behind the stairs, as he patrols around, so he might not have seen you the first time you were there. If you're sure that you were seen in the basement yet no one attacked you, then it could be a bug.