Use one system hard disk alternately for two identical PCs

Just because they look identical does not mean they truly are.

Windows relies on some unknown mixture of hardware IDs and serial numbers in order to validate your product licence. If those IDs suddenly change, as they would when moving a hard drive from one machine to another, then windows will deactivate itself. If both machines have valid licences then they should reactivate. The problem is though that we don't know what limits there truly are on reactivations.

It could be three per month, or five per year. From what I know "minor" changes to things like memory and hard drives do not actually deactivate the licence, but it could be that it still ends up generating a new hardware ID that is linked to the old one.

Swapping a hard drive between machines though would be an entirely different hardware ID and would not work.

While you can sysprep a Windows installation to allow you to clone it between machines, it is not intended to be used for this purpose.