The study consists of a screening epoch, a ramp-up epoch and treatment epochs. Participants who have been receiving intravenous IgG (IVIG), will enter a ramp-up epoch which will start 3 or 4 weeks after the last IVIG pre study dose before screening. Participants who have already been receiving HYQVIA treatment, including those rolling over from previous studies (TAK-771-3004 [NCT05513586]/ TAK-771-3005 [NCT05150340]), will directly enter the treatment epochs after screening. Participants aged greater than or equal to [>=]16 years will be randomized at a 1:1 ratio to one of the following treatment sequences: either TAK-881 followed by HYQVIA or HYQVIA followed by TAK-881. Each participant aged greater than or equal to [>=]16 years will complete both crossover epochs. Participants aged 2 to less than [<]16 years will complete a nonrandomized treatment epoch (TAK-881 only).
The main aim of this study is to evaluate the PK, safety, tolerability and immunogenicity of subcutaneous (SC) administration of TAK-881 in adult and pediatric participants with PIDD and compare them to HYQVIA in participants 16 years old and older.~The participants will be treated with TAK-881 or HYQVIA with the same dose and dosing interval of immunoglobulin for up to 32 weeks as they were treated with another immunoglobulin before enrollment.~Participants will need to visit the clinic every 3 or 4 weeks during the duration of the study.