Another answer addresses a valid point: if person A and B switch DNA, person A's immune system will recognize new cells or antigens produced with person B's DNA as foreign and attack them. I agree that this is the most obvious cause of death. However, this might not necessarily result in death due to an important consideration: the antibodies on the surface of cells, immune and otherwise, are produced from instructions in DNA.
This would mean that as soon as person A and person B switched DNA, person A's immune cells would begin producing person B's antibodies and person A's other cells would begin producing person B's antigens. Even long-lived cells like neurons actively recycle cell-surface proteins. Because of this, assuming a person can survive long enough for their cell-surface proteins to be replaced, there's no immediate reason they would die.
Furthermore, in many situations, immune antibodies are "used up" once they bind to a foreign antigen, and many immune cells have a turnover measured in days, and this is shorter if they're fighting an infection. This would be even faster given new immune cells made with person B's DNA possessing person B's antibodies would be actively attacking person A's old immune cells possessing person A's antigens. If someone can survive the initial allergic reaction and doesn't develop an autoimmune reaction to their new antigens during this period, they may not immediately die.
However, as another answer points out, DNA is very interconnected to the rest of the body. Which proteins are being transcribed from the same sequence of DNA varies from cell to cell even in the same body due to epigenetics. If the transporter is merely randomly swapping chromosomes, this could lead to death. For instance, since every cell in the body has the instructions for how to make stomach acid, if person A's heart suddenly gets DNA actively transcribing proteins to help digest food, that could be fatal. Person A and B have different numbers of cells and different numbers of each cell type, and epigenetics in their brains are important for memory and personality. Even if the transporter attempted an approximate cell type-to-cell type chromosome swap (liver to liver, skin to skin, etc.), this could result in cognitive deficits, massive metabolic dysregulation, and down the road, cancer.
On the other hand, thinking optimistically, we can also assume the transporter is aware what DNA is and how epigenetic regulation works. In this case, since most humans have the same genes, just different versions of each gene, the transporter could simply set the level of transcription of person B's genes to the same level those same genes (just different versions) were previously being transcribed in person A's cells. In this case, if person A survives the initial immune response, they may be able to live on indefinitely, just with diffuse and unpredictable changes. For instance, their earwax may go from wet to dry. Regardless, they would probably suffer from obscure illnesses due to cells growing in a scaffold (body) made using different instructions than those they contain--maybe person B's DNA for blood filtration assumes a certain kidney structure.
In sum, it really depends on how exactly the transporter is swapping DNA and how bad the initial immune response is.