Therefore, if A's patent is invalid, it is regarded as never having a patent.
B's own patent has nothing to do with this, as long as it is still valid, it is still protected by law.
The production of products with original patent A is not infringing, but the production of products with patent B may be infringing.