It’s so called „revenge bedtime procrastination” (
https://en.wikipedia.org/wiki/Bedtime_procrastination).
I think the reasons behind it usually fall into the same category, which you and parent commenter both mentioned - taking control over your time/life and “fixing” otherwise unsatisfying day.