Frappe.msgprint does not work on server script event after_insert


I find that frappe.msgprint does not work for server event after_insert, however it does work for before_save.

def  before_save (self):
    frappe.msgprint(f'before_save : {}')

Screenshot from 2022-07-17 20-51-08

However, when I change the event to before_insert or after_insert

def after_insert (self):
    frappe.msgprint(f'after_insert : {}')

then no message is shown. Is this a bug or is there a reason for it?