The LoadBoard() function is invalid?

At the moment it is not possible to use the LoadBoard API inside the scripting console or an action plugin. You can use GetBoard to get the board that is loaded in the PCB editor, but you cannot load a different board (that is not loaded in the PCB editor).