Are spacecraft electronic systems built in a modular way that allows astronauts to switch identical cards in case of damage?
Design for repair is usually done with the final environment in mind.

In avionics and the military, they use the term LRU, Line Replaceable Unit, for what a 'front line' repair is expected to do. These usually come down to a rack mounted module of several litres, that plugs into a rack. Here, rapid repair by technicians with limited training, in field conditions, is paramount. 'Second line' repair, done back at base, involves opening the modules and doing board swaps. Repair at the component level would be sent back to the manufacturer. I am not so much worried about the details, but the fact that a maintenance and repair strategy has been designed in from the start, and is part of the procurement specification of the equipment.

If a deep space mission was being planned, part of the environment to consider would be that no new gear could be brought up, that the technicians were limited in their electronic skills, but that conditions were clean, and that time to repair probably was not of the essence, especially as the systems themselves would be duplicated. This means that board swap would probably be considered to be the primary repair strategy. To minimise the number of spares carried, this would require common boards wherever possible, and this would be demanded of all suppliers of systems to the project.

Spares would be carried. Cannibalising a system to get a board would be possible, but an option of last resort. If the story had them doing this, then they had already suffered a lot of failures, and used their spares.