No existing autocmd to execute right before buffer deletion

Hi, I have this autocmd:

vim.api.nvim_create_autocmd({"BufWipeout"}, {
    pattern = "*",
    callback = function()
        vim.cmd([[call cursor(1, 1)]])
        vim.cmd([[mkview | filetype detect]])
    end
})

It didn’t work, I tested with BufDelete, BufWipeout, BufUnload, BufWinLeave and maybe another one I does not remember.

  1. BufDelete; BufWipeout: Nothing happens.
  2. BufUnload; BufWinLeave: Unwanted behavior occurs (since I need the commands to execute only and right before the buffer ceases to be.

Anyone have a suggestion to fix this?

Thanks.