They did not perish for a lack of giving, but for lying. What they had was theirs, to keep or give, as they ppleased. Their sin was that they claimed they had given all they had, while secretly holding a portion unto themselves. If they had chosen to keep that portion and openly declared it, they would not have perished. They died for doing what you just did, lying.