Error: cannot resume dead coroutine

From somewhere in the code bellow I’m getting the error “cannot resume dead coroutine”
The error message did not say which line and I don’t know what to try.

local function doFight()
	local runFight = coroutine.create(function()
		zoneEvent:Fire(nil, nil, nil, nil, "None", nil, 32)
		doBoundaries(true)
		moveBells()
		task.wait(1)
		zoneEvent:Fire(nil, nil, nil, nil, "PointyReckoning", nil, 32)
		syncBells(game.SoundService.PointyReckoning)

		while fightActive and not clangorDefeated do
			lungeAt()
		end
	end)
	coroutine.resume(runFight)
		
	--Disable fight if player dies
	player.Character.Humanoid.Died:Connect(function()
		if coroutine.status(runFight) ~= "dead" then
			coroutine.close(runFight)
			resetFight()
		end
	end)

	return runFight
end

doFight()

edit: yes, the doFight is only called once

coroutine.close() sets the coroutine to ‘dead’ state

That what the code is suppose to do. That’s why it checks if it is in dead state first. The code is suppose to stop the fighting if the player dies