This particular problem was caused by deleting the rig_ui.py file and replacing it with the rig_ui.py file generated in a different file. The rigify plugin creates and executes the script which is partly specific to the rigify rig that it's generated with. It's found in the scripting tab.
The problem is solved by going to the scripting tab, and checking a specific line in the 'rig_ui.py' script.
On line 6, where it says 'rig_id =' there should be within quotes, a specific code that should match the code found on your rig.
To find your rig's ID, select your rig and check the rig properties. Underneath 'Custom properties' copy the 'rig_id' code. Check to see whether it matches the code mentioned in the rig_ui.py script. If it doesn't match, that's the problem, so delete the code inside of the quotes. Paste in your rig's ACTUAL id in the code, inside of the quotes next to 'rig_id ='.
Now hit 'Run script' on the toolbar below and the buttons on the N menu should return.