While it is difficult to sort out actual causation of delays in processing a particular application, there is a known correlation between IRCC's perception that a citizenship applicant has relocated abroad, or is outside Canada for an extended period of time comparable to residing outside Canada, and an increased risk of delays relative to other applicants applying at the same time and being processed in the same local office. Even though taking the test while outside Canada does not necessarily mean the PR is living abroad, odds are this sometimes triggers the perception the applicant has relocated abroad, in turn triggering elevated scrutiny, which may be about verifying physical presence or clearing prohibitions, or both, leading to delays. Again, it is difficult to say that is what explains why YOUR application is proceeding more slowly, but it is, as one might say, among the usual suspects.
If so, this would be another sign that pursuing mandamus relief at this juncture is NOT likely to resolve issues arising from the need to travel after PR card expires later this year.
Hopefully you are nearing the end of the process and will be scheduled for the oath soon. In the meantime, however, there is no guarantee that will happen (probably good chance, but far shy of a sure bet), so unless you can travel via the U.S. to return to Canada, you will be relying on obtaining a PR TD if you are abroad after your PR card card expires and you have not been delivered a new one. Best to orient your decision making accordingly.
Let's try to be honest, and focus on what is known, in particular on information that will help PRs applying for citizenship make decisions, decisions like IF and WHEN it might be efficacious to invest in pursuing mandamus relief.
Mandamus and a Limited Time Offer for a Career Opportunity:
If a career opportunity dependent on having a Canadian passport opens with only a narrow window in time to take advantage of it, electing then to pursue mandamus relief is not likely to save the day. Mandamus relief is not quick relief.
While some may report that filing for mandamus has generated an "immediate" response, there is a preliminary procedural process that MUST be followed in order to even file an action for mandamus relief, and that takes time. Moreover, if IRCC has not already taken action to approve the application and schedule the oath during the preliminary procedure that must precede filing an application for the writ, and the PR is actually filing, in the Federal Court, an action seeking the writ of mandamus, the odds are very high that the process leading to a FC hearing alone will take many months and quite likely a year or more; moreover, those who are deciding whether to file a mandamus action in the FC, based on delayed processing, should be aware that very, very few of these are successful.
So that reporting, as to immediate relief, is either malarkey, or is at best hyperbolic and actually about getting a positive response from IRCC in response to the initial step in pursuing mandamus-relief (the demand notice). Even as to the latter, which clearly is the practical objective in hiring a lawyer with the hope (emphasis on hope) that will accelerate the time remaining to taking the oath, there is little reliable reporting demonstrating it succeeds in leading to the oath very much sooner except, perhaps, for a FEW applicants. Moreover, in the best case scenario with the fastest timeline (which most applicants will not have), even this will take a significant amount of time. Even in these best case scenarios, many times the applicant will still be unable to anticipate, with any confidence, when they will actually be scheduled for the oath, be that in the coming weeks or so (more likely months).
Neither quick enough nor reliable enough, with some roll of the dice or otherwise unusual exceptions, to take advantage of a sudden, limited time career opportunity.
Other Scenarios; OP's Situation in Particular:
For the OP here, PR card expiring in October and apprehending a need to travel internationally in October, there is no better than a remote chance that a lawyer-submitted demand as a preliminary step in pursuing mandamus relief will save the day. Hopefully a PR card application ($50 fee, a little or so less than 10 grand) will.
For sure, if it were to go beyond the demand stage, for the OP there is virtually no chance that an application to the Federal Court seeking the grant of mandamus will result in obtaining a Canadian passport by October. In the meantime it is possible (and given the timeline perhaps probable) the OP will be scheduled for the oath in time to obtain a Canadian passport by October, anyway, but given the amount of time it takes to pursue mandamus relief, unless it is IRCC that decides (prior to any Court order) to proceed to complete the process and schedule the oath, a Federal Court action will not get the OP there. It could easily take a year for the Federal Court to even hear and decide the case.
Addressing IRCC's Dismal Timeline Performance Generally:
The impact of IRCC's notoriously and dismally slow processing, which far too many suffer, warrants a concerted overt effort to not just encourage but compel improvement. However, mandamus is not the remedy for this. Appropriate advocacy regarding this issue (but ranging widely in efficacy) is discussed in many topics here.
Distinguishing Availability of Mandamus Relief on Other Grounds:
There are other situations involving citizenship applications in which the prospective availability of mandamus relief is an important remedy. It can make the difference between getting the grant of citizenship or being denied. Who, why, and when, is a broad and complex subject, DIFFERENT from, DISTINGUISHABLE from employing the mandamus procedure in an effort to accelerate an otherwise no-question-qualified applicant's timeline to taking the oath.
Make no mistake: the accelerated timeline to taking the oath by a no-issues, clearly-qualified applicant is about prodding IRCC to decide to act sooner, prodded by what many would describe as a threat of legal action. Success in this regard is all about persuading IRCC to act sooner than it would have, toward approving the application and scheduling the oath sooner; this is not about compelling IRCC. And it will NOT work unless the applicant is among those who have no issues (no lingering questions about physical presence for example) and is clearly-qualified . . . that is, it will not work unless the application is already very close to completion anyway.
Stated from the other direction: If the application is not already in a ready-to-schedule-oath condition, that is if there are issues or questions IRCC still has, the applicant is probably looking at a significantly longer timeline DESPITE a demand made by a lawyer.
Otherwise, if IRCC is not persuaded to proceed sooner based on the demand, the timeline ahead will NOT be short, and indeed it could go long. If things reach the stage where an actual action in the FC is filed, seeking the writ, the odds are there is a long road ahead.
Reminder:
Finally, a reminder, there is NO mandamus available to compel IRCC to process a citizenship application within any particular time period, definitely NOT within what many would categorize as a "reasonable amount of time."
At the least, to be grounds for mandamus relief the unreasonableness of the delay in the current stage of processing must generally be such as to more or less, in its effect, be a refusal to process the application and a breach of procedural fairness. A very high bar. High enough bar one that one does not see many, no where near many, cases in which the Writ is actually granted for a delay in processing a citizenship application. While the amount of time is an important factor, time is NOT dispositive.
The hope, again emphasis on it being "hope," is that a lawyer's demand will prompt IRCC to choose to proceed sooner. And for more than a few that likely succeeds, relatively, as in not necessarily all that quickly and not necessarily a whole lot sooner.