This is a custom stack error. The issue is quite easy, but not with what you have here.
If I had to guess, this is a custom error handler either prepended into the run or included in something we can't see. I would suspect it is caused by this: , for which $_POST['id'] may or may not be defined. Treat it as you have with the $_GET at the bottom and use an isset ternary check.
That said, it also doesn't do anything in specific. Since its not printed, its simply tossing an error but will never actually output anything.