Display $pagenow error notice on all admin pages

function my_admin_notice() {

    /*
     * The class of admin notice should be "notice" plus any one of
     * -"notice-error",
     * -"notice-warning",
     * -"notice-success"
     * -"notice-info".
     * Optionally use "is-dismissible" to apply a closing icon.
     */

    echo '<div class="notice notice-info"><p>Custom notice text</p></div>';

}

add_action( 'admin_notices', 'my_admin_notice' );

The only thing is, these notices does not show up on New Post, Edit Post and similar where Gutenberg reins. There must be the solution, but I can’t find it right now.