That's so wild. A smart company would be begging their employees to learn how to solve new problems on the weekend for fun. Intellectually curious people are exactly who you want.
The only way this would make sense would be if you signed an NDA or something that would prevent you from participating in the specific hackathon, because secrets.