External ISO keyboards treated as ANSI since MacBook Pro upgraded to macOS Sierra 10.12
I had the same problem with my keyboard and a German layout. Although I had "German" set up as "System Preferences/Keyboard/Input Source" most of my keys had the wrong mapping. E.g. the key right to the Left Shift Key on my keyboard is "&lt;>" instead it was mapped to "^°".

The problem was that my keyboard was setup as an ANSI-type of keyboard (used in the US). Instead it should have been set up as a ISO-type (used in most european countries).

There are several possible solutions to this mapping problem as described by Tom Gewecke on his Blog.


  The fix for this is to run the Keyboard Setup Assistant again. Sometimes there is a button for "Change Keyboard Type" visible in "System Preferences/Keyboard".
  
  If not, you can try trashing the file
  /Library/Preferences/com.apple.keyboardtype.plist
  and restarting your machine.
  
  Another possibility may be to open Terminal and type:
  sudo open /System/Library/CoreServices/KeyboardSetupAssistant.app/Contents/MacOS/KeyboardSetupAssistant


When the Keyboard Setup Assistant appears again after reboot be sure to choose the right type of keyboard - ISO.

If none of that helps follow the above link to Toms post with further options.