Yes taking protein before bed can keep you awake because the protein contains the amino acid tyrosine, which promotes brain activity.
The promotion of brain activity during the night due to the tyrosine will keep you awake so avoid taking protein before bed.
Take the protein when you wake up or during the day when you're gonna be awake because the protein can keep you awake.
I had trouble sleeping when I tried taking protein before bed so I stopped taking the protein before bed and only took it during the day or first thing in the morning when I woke up.
The protein actually helped wake me up in the morning and give me more energy during the day.