Invisible buttons (or buttons on invisible layers) can still be clicked.
You need to add another condition to your "On QuitButton clicked" event - something like "Is Layer PauseLayer visible" or "Is GamePaused".
Another way to do this is to move all PauseLayer events to a separate group in your event sheet, and disable this group. Enable it only when player presses pause.
By the way, you should also be aware, that when your PauseLayer is visible and you click a button on it, this click may be registered by your main game events - your character will fire a weapon or something like that. So you need to disable game controls group when you activate PauseLayer.