I didn’t read through your code, so, although you’re intimately familiar with it and what you’re trying to do, I am not.
That said,
What EXACTLY is your issue with the Perception System?
You said:
As in, the AI doesn’t behave properly after SENSING AND LOSING the player. Now you’re saying it doesn’t perceive at all?
This is what I mean about keeping it simple, because you have to be VERY specific or important details get confused.