How to properly register a file extension on mac so it will also work by running open from the command line?
If you selected Always Open With from a context menu, it only changes the default application for the selected items. If you change the default application from an information window, it normally also has an immediate effect on open.

If it wasn't that, com.apple.LaunchServices.plist can also be edited as XML:

plutil -convert xml1 ~/Library/Preferences/com.apple.LaunchServices.plist


Applying changes requires restarting. Logging out and back in isn't enough.

You could also try using duti or RCDefaultApp.