It does not apply to dying declarations and statements made under impending death, this is well established in law. [1] Otherwise mob bosses would just pop off every witness and go fully free if it is completely inadmissible . There are limits not everything is admissible however not everything can be thrown away either
[1] https://constitution.congress.gov/browse/essay/amdt6-5-1/ALD...