If your application is raising <PROTECT> errors and you're finding it hard to work out why, here's a way to get additional information.
First, if auditing is not already enabled, turn it on:
Then use "Configure System Events" (highlighted above) and locate the event named %System/%Security/Protect. In the screenshot below I used the Filter field to do this (type "protect" - highlighted below - and press TAB):