In this example, the right-click context menu was not working on some forms, in addition to the magnifying glass lookup. It seemed to only occur on the forms like incident, problem, and change when the active flag was set to 'true'.
The reason for the right click context menu not working was because the form was broken by an uncaught reference error shown in the console. For this particular scenario it was being caused by a custom UI Action: 'Import CI'
The reason why the UI Action was generating the error was because the script was attempting to use the method 'sn_impex.GlideExcelParser();' which is a scoped server side method. But for the UI Action, the form had the 'Client' field checked, so it was attempting to run as a client side script only, which generated the error.
Then the reason it was only appearing when the form was active is because the UI Action was not present when the state was closed.
The resolution for the UI Action was to de-activate, and depending on if it was still wanted on the form, the unchecking the client script field would also stop the error.