New all-out installation of an old computer with time machine from another computer I understand that time machine sometimes makes troubles when recovering thing it took from one computer to another computer that’s why the following question arises:

I have two Macs with the same Apple ID but different contents. Now I want to use the time machine from Mac A, erase everything from Mac B and initiate Mac B anew with the time machine from Mac A so as to have two identical computers.
Is that a problem?
In theory no it's not a problem but you'd be better off using SuperDuper! or Carbon Copy Cloner to make an identical clone using Target Disk Mode over FireWire or Thunderbolt.

Also Apple has a built in app for migrating data via FireWire, Thunderbolt and Ethernet, even Wi-Fi if you want to wait!

The migration option is given after a fresh OS install, so if you are trying to get a clone these options would be a better bet than making a Time Machine back up then restoring from it, importantly the option for the Migration Assistant is actually in the same list of options at restoring from a Time Machine backup after a fresh OS install.