save_post hook – headers already sent?

Saving post doesn’t just happens. Either you are submitting a form or ajax request, which spins up new copy of WP core, which does the saving. Typically that process isn’t meant to produce output and isn’t handling it accordingly.

Depending on what you want to accomplish you will have to either use pure JavaScript for solution or store the message during saving persistently and output it at more appropriate point in the process.