The query key for the useContractEvents hook uses a hash based on an event's signature without taking into account any filters applied to it, so if the filters change, the hook continues to return old data prepended to the new event data.
https://github.com/thirdweb-dev/js/blob/main/packages/thirdweb/src/react/core/hooks/contract/useContractEvents.ts#L91
Proposed fix is to add the encoded topics to the query key:
const eventsKey = useMemo(
() =>
events?.reduce((acc, curr) => {
// we can use the event hash as a unique identifier?
return `${acc}${curr.hash}${curr.topics.join()}_`;
}, "") || "__all__",
[events],
);