Destroy() not working with a NPC including GUI

NPC construction:
image
Snippet of code used:

    local function onHealthChanged(Health)
        if Health <= 0 and not self.Dead then
            self.Dead = true
            Debris:AddItem(self.NPC, 0)
			self = nil
		end
	end
    Hum.HealthChanged:Connect(onHealthChanged)

self.Dead is a bool value

Outcome:
image
https://gyazo.com/47158e5df49b38af44bfcc0b15e1f4c6

I want to see some videos any videos? That will help

self cannot be used in that function. To get access to self you need to set up something like this:

local functions = {}

function functions:onHealthChanged(Health)

end

https://gyazo.com/47158e5df49b38af44bfcc0b15e1f4c6

That is a code snippet including just the code section with the problem, the whole code contains a metatable and functions.

Mob = {}
Mob.__index = Mob
function Mob:Start()
    local Hum = self.NPC:WaitForChild("Humanoid")
    local CurrentHealth = Hum.Health

    local function onHealthChanged(Health)
		if Health < CurrentHealth then
			self:HitEffect()
		end
		
        if Health <= 0 and not self.Dead then
            self.Dead = true
            self.Clone.Parent = game.Workspace
            NPCManager.Initialize(self.Clone)
            Debris:AddItem(self.NPC, 0)
			self = nil
		end
	end
	
    Hum.HealthChanged:Connect(onHealthChanged)
    end
end

^Still not the full code but its showing the main function and the table

I still think you should try avoiding overwriting self. Try not using self.

Its OOP, each mob has its table with its functions.

Where do you define self.NPC in your script?

in the Initializing function.
The code runs all good until the debris, which deletes the model but keeps the UI.
No need to check other sources of error outside the snippet in the post.

Is the UI parented under the NPC?

Yes, as in the image I posted it is under an attachment in the HumanoidRootPart

Turns out it was a bug that got fixed by restarting the studio.