I got this function that works in harpoon:
function()
local index = require("harpoon.mark").get_current_index()
if index ~= nil then
local config = require('harpoon').get_mark_config()
table.remove(config.marks, index)
local global_settings = require("harpoon").get_global_settings()
if global_settings.tabline then
vim.cmd("redrawt")
end
end
require("mini.bufremove").delete(0, true)
end,
This function removes harpoon mark and also deletes buffer using mini.bufremove.