There's a lot of back and forth here so just want to clear this up, if the Q&A above is accurate, it's clear that:
Attacks of opportunity do NOT occur when the targeted location for investigation has an enemy. This is because attacks of opportunity occur when you spend the action, which happens at your current location before the investigate.
I believe in reading that, it can be assumed that attacks of opportunity do NOT occur when the target location has a massive enemy either. For the same logic above, attacks of opportunity happen before the application of an actions effect. Meaning there's no additional check for AoO on the targeted location.
I've still seen some doubt about massive enemies, but based on the Q&A here I don't see why there would be any doubt.