Court records show the attacker left a psychiatric facility just 72 hours before the rampage; he had been freed from prison weeks earlier