Devise sign-out flash message lost

The Devise sign-in flash message is displayed correctly after redirecting to the stored location for a user. I’ve overridden session#destroy so that it also redirects to the stored location (rather than root), but the corresponding flash message is lost, and I cannot see why. These are the relevant bits from my SessionsController:

class Users::SessionsController < Devise::SessionsController

  def destroy
    # The commented out lines make no difference
    # set_flash_message :notice, :signed_out
    # flash.keep(:notice)

  def after_sign_out_path_for(resource_or_scope)

Before you ask: no, the stored location does not perform any additional redirects. I’ve looked through the Devise documentation, and their Github issues, as well as StackOverflow and the web in general, but no one else seems to have this issue. Weird.

I’m not sure how this is any different, but with the below code the signed_out flash message is displayed correctly:

  def destroy
    flash[:notice] = t("devise.sessions.signed_out")
    sign_out current_user
    redirect_to after_sign_out_path_for(:user)

That set_flash_message – is that from Devise internals? It doesn’t seem to be a part of Rails.