The Edge 840 runs on 21.17. I was able to set a longer pass phrase through the Garmin Connect app. BUT the limitation is still there when I try to connect to the WiFi directly on the device.
Good news! I did a factory reset on my Edge 840. Reconfigured the initial settings and added the WiFi manual. This time I was able to set a longer pass phrase. So it seems the character limit is fixed in v21.17... if it does not work for you, try a factory reset.