It's quirky at best. I have an Android tablet that uses my wifi network to connect. Most of the time it works, but sometimes it doesn't. It's possible that your connection was just fuzzy at the time you tried and thats why it didnt connect.
Since you eventually were able to login, this is not your problem, but for others with a similar problem, many WiFi-capable routers have a security setting that prevents logging in via the wireless connection. Thus a PC on the wired LAN could login fine, but the Chromebook (or any other wireless device) could not.
One could always try to connect to the router with a wired connection to test if it was a wifi issue. A cheap USB/Ethernet dongle works well for doing wired on a Chromebook and saves a ton of trouble setting up a new Chromebook before one can access a file/flash memory with a long password to cut/paste.