it doesn’t make any logic, as yii\Application works like locator (register+factory+strategy) so it must be accessible at any time after app’s run() execution.
My only guess after crawling the source code (isGuest is a magic property) is that your behaviours function is called before the User object has been constructed, in which case the isGuest property does not exist yet since it is actually implemented as a magic method in yii\base\Object.
You could see if it works by calling getIsGuest() as a function, which is actually defined in User and see if that gets around your problem but if you are calling it too early, it sounds like it will always return true anyway.
The only workaround I can think of is to pull the isGuest out into the behaviour class itself rather than in the behaviors() function. This way, by the time the behaviour functionality is actually invoked, the user will be known and loaded, effectively moving the logic up another level.