It's difficult to figure out by your screenshots, but one mistake I noticed is that you are using arrInventory.CurValue in event 193. CurValue expression is only available in "Array For each element" loop. It will not work in System-For loop. But, the problem with Array-For loop is that you can't stop it, so you'll need to rewrite some of the code.
Besides, your events 192-193 are inside the For loop, so they are executed multiple times. I think the structure of your function should be like this:
On function checkProhibitedItems
...System For x from 0 to arr.width-1
......arr contains
...prohibitedItemsLoop=arr.width : success
...Else : fail
Also, prohibitedItemsLoop counter is not a good indicator that the array doesn't contain prohibited items. What if the prohibited item is the last element in the arrInventory? The loop will stop at the end, but the function will still return "success". I suggest using a boolean variable "prohibitedItemFound" instead. Set it to 1 if array contains prohibited item.
.
Finally, try running the game in debug mode and also add Browser-Log actions in key events to print some important information, like variable values etc. This will help to understand what's going wrong.