Use buffer-display-table instead of standard-display-table:
(defun my-text-mode-hook-fun ()
(setq buffer-display-table (make-display-table)))
(aset buffer-display-table ?\t (vconcat "!---")))
(add-hook 'text-mode-hook #'my-text-mode-hook-fun)
Also note that there is the highly configurable whitespace-mode for your ...
Emacs has some variables to configure when the debugger should be invoked. They all begin with debug-.... For your situation the variable debug-on-message could help.
Set it to the string of the message and trigger the error. This should open a backtrace, which should help you to find the problematic piece of code.