
471 B.R. 555 (2012)
In re VALLEY HEALTH SYSTEM, Debtor.
Peggy Kirton; Diane Agnello, Appellants,
v.
Valley Health System; Valley Health System Retirement Plan; Joel Bergenfeld, Trustee; Vinay M. Rao, Trustee; Michele Bird, Trustee, Appellees.
BAP No. CC-11-1100-MkHPa. Bankruptcy No. 07-18293. Adversary No. 10-01566.
United States Bankruptcy Appellate Panel of the Ninth Circuit.
Argued November 16, 2011.
Submitted February 7, 2012.
Decided March 13, 2012.
*557 Gary E. Klausner of Stutman, Treister & Glatt PC, argued for Appellee Valley Health System; Mark Attwood of Jackson Lewis LLP argued for Appellees Valley Health System Retirement Plan and the following persons as trustees of the Valley Health System Retirement Plan: Joel Bergenfeld, Vinay M. Rao and Michele Bird.[**]
Before: MARKELL, HOLLOWELL and PAPPAS, Bankruptcy Judges.


*558 MEMORANDUM[*]
PETER H. CARROLL, Chief Judge.

INTRODUCTION
Peggy Kirton and Diana Agnello ("Kirton Parties") are former employees of Valley Health System ("VHS") and were participants in the Valley Health System Retirement Plan ("Retirement Plan"). After VHS confirmed its chapter 9[1] plan of adjustment, they filed in state court a petition for writ of mandamus ("Petition") against VHS and others seeking to enforce their alleged rights under the Retirement Plan. VHS removed the Petition to the bankruptcy court. Along with other named respondents, VHS then filed a Civil Rule 12(b)(6) motion to dismiss the Petition, which the bankruptcy court granted without leave to amend. The Kirton Parties filed a motion for reconsideration, which the bankruptcy court denied.
The Kirton Parties appeal from both the dismissal order and the order denying their motion for reconsideration. Because the bankruptcy court lacked subject matter jurisdiction over the Petition, we VACATE and REMAND.

FACTS
VHS is a local healthcare district under the California Local Health Care District Law, Cal. Health & Safety Code § 32000, et seq. See In re Valley Health System, 429 B.R. 692, 700 (Bankr.C.D.Cal.2010). VHS owned and operated one skilled nursing facility and three acute health care facilities in Riverside County, California. Id. VHS filed a chapter 9 bankruptcy petition in December 2007, and the bankruptcy court entered an order for relief in the case in February 2008.
Pursuant to § 943, the bankruptcy court confirmed VHS's first amended plan of adjustment ("Chapter 9 Plan") by order entered April 26, 2010 ("Confirmation Order"). The Chapter 9 Plan was based on the sale of substantially all of VHS's remaining assets to another entity known as Physicians for Healthy Hospitals, Inc. ("PFHH"). Among other things, the Chapter 9 Plan provided for the discharge of VHS's prepetition debts and also enjoined claimants from pursuing any action or proceeding on account of such debts.[2]
The Chapter 9 Plan specifically addressed VHS's obligations under its Retirement Plan:
Defined Benefit Plan Participants will be entitled to the same rights and benefits to which such participants are currently entitled under the VHS Retirement Plan and the MetLife Group Annuity Contract, and such participants *559 shall have no recourse to the District or to any assets of the District, and shall not be entitled to receive any distributions under this Plan. Instead, all unallocated amounts held by MetLife Group, pursuant to the VHS Retirement Plan and the MetLife Group Annuity Contract, will continue to be made available to provide retirement benefits for participants in the manner indicated under the provisions of the VHS Retirement Plan and the MetLife Group Annuity Contract. Accordingly, the treatment of Allowed Class 2C claim holders set forth herein shall not affect any legal, equitable or contractual rights to which the VHS Retirement Plan participants are entitled.
Chapter 9 Plan (Dec. 17, 2009) at 16:13-22. Based on this treatment, the Chapter 9 Plan characterized the Class 2C claimants  the Retirement Plan participants  as unimpaired and stated that they therefore had no entitlement to vote on confirmation of the plan. These same plan terms were reiterated in VHS's first amended disclosure statement, filed concurrently with the Chapter 9 Plan.
The record reflects that the Kirton Parties were served with advance notice of: (1) the claims bar date, (2) the court approval of the first amended disclosure statement, and (3) the confirmation hearing on the Chapter 9 Plan. The record further indicates that the Kirton Parties were sent copies of the Chapter 9 Plan and the first amended disclosure statement at the same time they were served with notice of the confirmation hearing. The Kirton Parties did not file any proofs of claims, did not object to VHS's Chapter 9 Plan, and did not otherwise participate in VHS's chapter 9 case.
On October 14, 2010, VHS issued a notice that the asset sale to PFHH had closed on October 13, 2010, and that October 13, 2010, was the effective date of the Chapter 9 Plan.
Meanwhile, back in August 2010, a few months after the confirmation of VHS's Chapter 9 Plan, the Kirton Parties filed their Petition in the Riverside County Superior Court (Case No. RIC 10017129). The Petition named the following parties as respondents:
 VHS, which the Kirton Parties alternately identified as a public entity and community hospital, and as a "California Local Health Care District."[3]
 The Retirement Plan, which the Kirton Parties alternately referred to as a public employee retirement entity, and as "an independent sui juris entity with constitutionally mandated fiduciary duties to the [Kirton Parties]." See Petition (Aug. 26, 2010) at ¶¶ 1, 2.[4]
 Joel Bergenfeld, Michele Bird and Vinay Rao, as individuals and as trustees of the *560 Retirement Plan (collectively, "Trustees").
 Met Life, Inc. ("Met Life"), as the administrator of the Retirement Plan.
The Petition enumerated four causes of action based on the following common allegations: (1) violation of the Retirement Plan; (2) violation of the California Constitution; (3) breach of contract; and (4) declaratory relief. The Petition's prayer for relief sought, among other things, the issuance of a peremptory writ of mandate directing the respondents to fund the Retirement Plan as required by law, to disclose VHS's underfunding and violations of the Retirement Plan and the California Constitution, to cease any concealment of underfunding/violations, and to prosecute any actions allowed or required to conserve the Retirement Plan's assets.
The gravamen of the Petition was that VHS allegedly underfunded the Retirement Plan to the tune of $100 million. The Petition further alleged that all of the respondents breached their respective duties to prevent or disclose (or both) VHS's underfunding of the Plan. Supposedly, these duties arose from the Plan itself and California Constitution Art. XVI, Sec. 17.[5]
On September 22, 2010, VHS filed a notice of removal pursuant to 28 U.S.C. § 1452(a) and Rule 9027, effectively removing the Petition from the state court to the bankruptcy court. VHS, the Trustees and the Retirement Plan (collectively, "VHS Defendants") then filed, in October 2010, a motion to dismiss the Petition under Civil Rule 12(b)(6) (made applicable in adversary proceedings by Rule 7012(b)).
First and foremost, the VHS Defendants argued that VHS's Chapter 9 Plan and the Confirmation Order had discharged VHS's obligations to fund the Retirement Plan. The VHS Defendants also argued, among other things: (1) the Trustees had no contractual or fiduciary obligations to the Kirton Parties under the Retirement Plan; (2) the Retirement Plan did not have the legal capacity to sue or be sued; (3) the Kirton Parties did not comply with the pre-filing requirements of the California Government Claims Act; (4) both VHS and the Trustees are immune from liability; and (5) the Kirton Parties failed to plead the requisite elements for mandamus relief or for relief under the causes of action alleged.
The notice of motion accompanying the VHS Defendants' motion to dismiss warned the Kirton Parties that, under Rule 9013-1(h) of the Local Bankruptcy Rules of the United States Bankruptcy Court for the Central District of California ("Local Bankruptcy Rules"), the court might treat a failure to file an opposition to the motion to dismiss as consent to the relief requested in the motion.
The Kirton Parties never filed an opposition to the motion to dismiss. However, on January 3, 2011, on the eve of the hearing on the motion to dismiss, the Kirton Parties did file a pleading entitled "Class Action  Plaintiffs' First Amended Complaint For Damages and Injunctive Relief." The First Amended Complaint was founded upon the same basic alleged misconduct as the Petition. The only essential differences were the addition of class action allegations and several new causes of action based on the same alleged misconduct.
At the January 4, 2011 hearing on the motion to dismiss, the bankruptcy court noted that the Kirton Parties never filed a *561 written opposition to the dismissal motion, even though the motion was filed and served over two months before, on October 22, 2010.[6] The court further noted that Local Bankruptcy Rule 9013-1(h) permitted the court to treat the Kirton Parties' failure to file a written opposition as consent to the relief requested in the dismissal motion. The court also determined that the Kirton Parties' amended complaint, filed on the eve of the January 4, 2011 hearing, contravened national and local bankruptcy rules requiring in advance either the opposing parties' written consent to the amendment or leave of court. Accordingly, the bankruptcy court declined to consider the amended complaint. Based on these findings and rulings, and based on all of the arguments made in the dismissal motion, the court granted the motion to dismiss without leave to amend.
The Kirton Parties objected to the proposed dismissal order lodged by the VHS Defendants. The Kirton Parties argued that the proposed order attempted to grant relief beyond that sought in the dismissal motion and to resolve matters not properly before the court. The Kirton Parties also argued that it would be improper for the bankruptcy court to grant the dismissal motion in favor of parties who had not been expressly named as movants in the dismissal motion. According to the Kirton Parties, granting the dismissal motion in favor of the unnamed parties would violate the Kirton Parties' due process rights. Finally, the Kirton Parties argued that the California Constitution deprived the bankruptcy court of jurisdiction over the Retirement Plan. The court overruled the Kirton Parties' objections and entered the form of order that the VHS Defendants had lodged.
The Kirton parties then filed a motion for reconsideration, which essentially reiterated the same arguments that the Kirton Parties had made in their objection to the proposed order. After the parties filed opposition and reply papers, the bankruptcy court ruled on the reconsideration motion without holding a hearing, in a memorandum of decision entered on February 24, 2011.
In its memorandum decision, the bankruptcy court first noted that it had subject matter jurisdiction over the litigation and that the matter was a core proceeding under 28 U.S.C. § 157(b)(2)(A), (I), (B), (L) and (O). The court next classified the motion for reconsideration as a motion under Civil Rule 59(e) to alter or amend the judgment and stated the legal standards applicable to such motions.[7]
After summarizing the VHS Defendants' arguments in favor of dismissal and the Kirton Parties' arguments in favor of reconsideration of the dismissal order, the bankruptcy court explained why it considered the Petition fatally deficient and why the reconsideration motion should be denied. The court first focused on VHS, its obligations to the Kirton Parties, and the effect of the confirmed, effective Chapter 9 Plan on those obligations. According to the court, VHS only had one retirement plan  the Retirement Plan  and VHS's only alleged pension obligations to the Kirton Parties arose from the Retirement Plan and were contractual in nature. The court also noted that VHS had not incurred any new pension obligations under the Retirement Plan since 1999 because *562 VHS had frozen the accrual of new pension benefits as of May 4, 1999. As a result, the court ruled that the alleged pension obligations all arose prior to VHS's bankruptcy filing and thus had been discharged by VHS's Chapter 9 Plan. The court also ruled that any objections or questions that the Kirton Parties could have raised concerning their treatment under VHS's Chapter 9 Plan were barred by the doctrine of claim preclusion.
The bankruptcy court next addressed its decision to dismiss the Petition as against Met Life, which had not joined in the VHS Defendants' dismissal motion. According to court, even though Met Life had not joined in the dismissal motion, Met Life was in the same position as the VHS Defendants vis-à-vis the Petition, so it was permissible for the court to dismiss the Petition as against Met Life as well. The court did not specify the precise grounds for dismissal that Met Life shared with the VHS Defendants. Moreover, with the exception of VHS, the court did not specifically describe why the Petition failed to state a claim as against any of the other named respondents. However, a fair reading of the court's rulings and comments in their entirety demonstrate that the court concluded, in part, that the Petition failed to allege sufficient facts from which the court reasonably could infer that any of the named respondents had a legally enforceable duty which they had breached and which had caused the harm alleged in the Petition. This is the common grounds for dismissal that all of the named respondents apparently shared.
The bankruptcy court then rejected the Kirton Parties' jurisdictional arguments. According to the court, it had subject matter jurisdiction over the Petition because it affected "the interpretation, implementation, consummation, execution or administration of a confirmed plan." Mem. Dec. (Feb. 24, 2011), at p. 11 (quoting State of Montana v. Goldin (In re Pegasus Gold Corp.), 394 F.3d 1189, 1194 (9th Cir.2005)). In addition, the court stated that, if the Kirton Parties believed that removal of the Petition to the bankruptcy court was improper, the Kirton Parties should have filed a remand motion within the time prescribed by Local Bankruptcy Rule 9027-1(c). The court further noted that the Kirton Parties had not, as required by Rule 9027(e)(3), responded to the VHS Defendants' allegation that the removed Petition was a core bankruptcy proceeding under 28 U.S.C. § 157(b)(2)(A), (B) and (L).
Finally, the bankruptcy court concluded that the deficiencies in the Petition "could not possibly be cured," so dismissal without leave to amend was appropriate. In so concluding, the court apparently relied on the numerous grounds for dismissal that the VHS Defendants asserted in their dismissal motion, but the court did not specify which of the Petitions' deficiencies were incurable.
Based on its memorandum decision, the bankruptcy court entered an order on February 24, 2011, denying the reconsideration motion. On March 6, 2011, the Kirton Parties filed a timely notice of appeal of both the dismissal order and the order denying reconsideration.

JURISDICTION
We have jurisdiction over this appeal pursuant to 28 U.S.C. § 158. We discuss the bankruptcy court's jurisdiction below.

ISSUE
Did the bankruptcy court have jurisdiction over the removed Petition?

STANDARD OF REVIEW
We review issues concerning the bankruptcy court's jurisdiction de novo. *563 See Rosson v. Fitzgerald (In re Rosson), 545 F.3d 764, 769 n. 5 (9th Cir.2008); see also Cal. Franchise Tax Bd. v. Wilshire Courtyard (In re Wilshire Courtyard), 459 B.R. 416, 423 (9th Cir. BAP 2011).

DISCUSSION

The bankruptcy court lacked subject matter jurisdiction over the removed petition.
We begin with a review of the relevant jurisdictional statutes because bankruptcy jurisdiction is "`grounded in, and limited by, statute.'" Battle Ground Plaza, LLC v. Ray (In re Ray), 624 F.3d 1124, 1130 (9th Cir.2010) (quoting Celotex Corp. v. Edwards, 514 U.S. 300, 307, 115 S.Ct. 1493, 131 L.Ed.2d 403 (1995)).
Under 28 U.S.C. § 1334(b), the federal district courts have "original but not exclusive jurisdiction" over "all civil proceedings arising under title 11, or arising in or related to cases under title 11." In turn, 28 U.S.C. § 157 provides the means by which the district courts share their bankruptcy jurisdiction with the bankruptcy courts. In accordance with the referral process authorized in 28 U.S.C. § 157(a), virtually all federal district courts have "referred" to the bankruptcy courts all of those matters over which the district courts hold bankruptcy jurisdiction pursuant to 28 U.S.C. § 1334.
As used in the bankruptcy jurisdiction statutes, the terms "arising under title 11" and "arising in a case under title 11" both have well-defined meanings. A proceeding to enforce a right to relief created by title 11 "arises under" title 11. In re Wilshire Courtyard, 459 B.R. at 424 (citing Harris v. Wittman (In re Harris), 590 F.3d 730, 737 (9th Cir.2009)). Wilshire Courtyard also identified when a civil proceeding "arises in" a bankruptcy case:
proceedings "arising in" bankruptcy cases, for purposes of the jurisdictional statute, are ... those that, although not based on any right granted in title 11, would not exist outside a bankruptcy case, such as matters related to the administration of the bankruptcy estate.
Id. (citing Maitland v. Mitchell (In re Harris Pine Mills), 44 F.3d 1431, 1435-37 (9th Cir.1995)).
As the parties seeking to invoke federal court jurisdiction, the VHS Defendants had the burden to establish facts supporting the federal court's subject matter jurisdiction. See Hunter v. Philip Morris USA, 582 F.3d 1039, 1042 (9th Cir.2009). Generally speaking, to determine whether removal jurisdiction exists, the court must look at the well-pleaded allegations of the complaint in order to ascertain whether it raises any bankruptcy law issues, without reference to any anticipated defenses that might be raised in response to the complaint. Miles v. Okun (In re Miles), 430 F.3d 1083, 1088 (9th Cir.2005).
Outside the removal context, subject matter jurisdiction is determined based on circumstances as they existed when the complaint was filed. See Buenting v. Crystal Cascades Civil, LLC (In re Crystal Cascades Civil, LLC), 398 B.R. 23, 28 (Bankr.D.Nev.2008). In contrast, in the context of removal, subject matter jurisdiction ordinarily is determined based on circumstances existing at the time of removal. Abada v. Charles Schwab & Co., Inc., 300 F.3d 1112, 1117 (9th Cir.2002) (citing O'Halloran v. Univ. of Wash., 856 F.2d 1375, 1379 (9th Cir.1988)). However, when the federal court determines the merits of the removed action without any remand motion, or without immediate appeal from the denial of a remand motion, the appellate court reviewing the trial court's merits determination also must consider "`whether *564 the federal court would have had jurisdiction had the case been filed in federal court in the posture it had at the time of the entry of the final judgment.'" See O'Halloran, 856 F.2d at 1379 n. 2 (quoting Lewis v. Time Inc., 710 F.2d 549, 552 (9th Cir.1983), abrogated on other grounds as recognized in Unelko Corp. v. Rooney, 912 F.2d 1049, 1052-53 (9th Cir.1990)).
Having reviewed the relevant jurisdictional statutes and having noted some ground rules for assessing the bankruptcy court's jurisdiction, we are ready to consider the jurisdictional issue raised in this appeal: the extent of the bankruptcy court's post-confirmation jurisdiction to interpret and enforce its own orders. The United States Court of Appeals for the Ninth Circuit recently addressed this issue in In re Ray, 624 F.3d at 1131-36. Because we believe that Ray controls the outcome of the appeal before us, we examine Ray in detail.
In Ray, the debtor and Jessen, his business partner, owned a shopping center called Battleground Plaza Shopping Mall ("Mall") and an adjacent parcel of undeveloped land ("Adjacent Land"). Id. at 1127. Ray filed a chapter 11 bankruptcy case in August 2000, and the bankruptcy court confirmed Ray's third amended plan in March 2002. Id. at 1127-28. Meanwhile, back in December 2000, Ray and Jessen had agreed to sell the Mall to a company known as Battle Ground Plaza, LLC ("BGP"). Id. at 1127. The sale agreement also gave BGP a right of first refusal to purchase the Adjacent Land. Ray's confirmed plan acknowledged the agreed-upon sale of the Mall to BGP, but noted that the sale had not yet closed. Id. at 1128. The plan also referenced Ray's intention to sell his interest in the Adjacent Land to either Jessen, BGP or some third party. Id.
In 2005, Ray and Jessen agreed to sell the Adjacent Land to a man named Maldonado. When Ray and Jessen notified BGP of the proposed sale agreement, BGP asserted that its first refusal rights were not "ripe" because the Mall sale still had not yet closed. Ray and Jessen then executed the sale agreement with Maldonado, and Ray obtained bankruptcy court approval for the sale of the Adjacent Land to Maldonado. BGP did not object to this first sale motion, but when Ray sought bankruptcy court approval a second time (to account for an agreed-upon reduction of the purchase price by $5,000), BGP this time objected, stating that it now desired to exercise its first refusal rights. Id.
The bankruptcy court overruled BGP's objection and, again, approved the sale, free and clear of all liens and encumberances, including BGP's first refusal rights. Id. at 1128-29. The bankruptcy court in relevant part found that BGP had not properly exercised its first refusal rights because its proposal to purchase the Adjacent Land did not mirror Ray and Jessen's sale agreement with Maldonado; rather, BGP's purchase proposal purported to extend the sale closing date and purported to give BGP the option to back out of the proposed purchase during a set period of time. Id. at 1129. BGP did not appeal either of the bankruptcy court's sale orders. Ultimately, the sale of the Adjacent Land closed. The sale proceeds enabled Ray to pay off his remaining obligations under his chapter 11 plan, and his bankruptcy case was closed in December 2005. Id.
Several months later, BGP learned for the first time that, as part of the sale of the Adjacent Land, Ray and Jessen had granted an easement to Maldonado that gave the Adjacent Land "valuable cross-parking rights" in the Mall's parking areas. Believing that the undisclosed easement materially changed the dynamics of the exercise of its first refusal rights, BGP *565 filed a state court breach of contract action against Ray, Jessen and Maldonado seeking damages and specific performance of its first refusal rights. Id. The state court "remanded" the lawsuit to the bankruptcy court, which concluded that it had subject matter jurisdiction over the lawsuit because the lawsuit necessitated the interpretation and enforcement of the bankruptcy court's prior sale orders. Ultimately, the bankruptcy court entered summary judgment against BGP and denied BGP's reconsideration motion. Id. According to the bankruptcy court, the breach of contract lawsuit amounted to an impermissible collateral attack on the court's prior sale order entered in November 2005, overruling BGP's objection and approving the sale of the Adjacent Land free and clear of BGP's first refusal rights. Id.
In an unpublished memorandum decision, this Panel held that the bankruptcy court had subject matter jurisdiction pursuant to 28 U.S.C. § 1334(b), because the breach of contract lawsuit "required resolution of a substantial question of bankruptcy law, i.e., the impact of the bankruptcy court's November 2005 Sale Order, arising under section 363(b)" of the Bankruptcy Code. Battle Ground Plaza, LLC v. Jessen (In re Ray), BAP No. WW-08-1104-KaJuPa, at p. 18, 2008 WL 8449610 (mem. dec. 9th Cir. BAP Dec. 31, 2008). The Panel also held that the bankruptcy court had ancillary jurisdiction because the breach of contract lawsuit implicated and potentially could undermine the bankruptcy court's prior sale orders. Id. at 14-16. Ultimately, the Panel affirmed the bankruptcy court, concluding in part that the bankruptcy court retained jurisdiction to interpret and enforce its own orders. Id.
The Ninth Circuit disagreed with the Panel's jurisdictional analysis. According to the Ninth Circuit, the bankruptcy court had no jurisdiction over BGP's state court breach of contract action. The Ninth Circuit considered each of the potential grounds of bankruptcy court jurisdiction and opined that none of them gave the bankruptcy court jurisdiction over BGP's breach of contract lawsuit.
First, the Ray court determined that the breach of contract lawsuit did not arise under title 11 or arise in a case under title 11. Ray held that the breach of contract lawsuit did not arise under title 11 because the lawsuit's existence did not depend on any substantive bankruptcy law provision; rather, the lawsuit merely sought to invoke BGP's state-law contract rights. Id. at 1131. Ray also held that the breach of contract lawsuit did not arise in a case under title 11 because it was not an administrative matter unique to the bankruptcy process; rather, the lawsuit had an existence independent of the debtor's bankruptcy case. Id.
Next, Ray distinguished several cases upon which the BAP, Jessen and Ray had relied.[8] According to Ray, in each of these cases, the plaintiff/movant was invoking substantive bankruptcy law rights or rights established in the bankruptcy court in the process of resolving the debtor's bankruptcy case. Id. at 1132-33. Ray determined that BGP's breach of contract lawsuit simply did not invoke any such rights: "the state court action is a breach of contract action claiming the Sellers did not honor the terms of the right of first refusal, which itself was created under *566 Washington law rather than as part of the bankruptcy proceeding." Id. at 1133.
Ray then examined whether the bankruptcy court had "related-to" jurisdiction over the breach of contract lawsuit. Ray applied the "close nexus test" adopted by the Ninth Circuit in In re Pegasus Gold Corp., 394 F.3d at 1194. Under the close nexus test, when a bankruptcy court is asked after plan confirmation to resolve a dispute, the court must determine whether "there is a close nexus to the bankruptcy plan or proceeding sufficient to uphold bankruptcy court jurisdiction over the matter." In re Ray, 624 F.3d at 1134 (citing In re Pegasus Gold Corp., 394 F.3d at 1194). In holding that BGP's breach of contract lawsuit did not satisfy the close nexus test, Ray considered significant the following facts: "the bankruptcy proceeding is over, ... a ruling on the state court claim by the state court would not affect the bankruptcy estate, and ... the state court claim should look to the preclusive effect of the [bankruptcy] proceeding." Id. at 1135 n. 7.
Significantly, Ray acknowledged that, if the state court ultimately did not give preclusive effect to the rulings in the bankruptcy court's sale orders, then the sale orders might be undermined and the debtor and the bankruptcy estate might be adversely impacted. However, Ray concluded that all courts routinely face collateral attacks of orders entered in other courts and that courts facing such collateral attacks routinely reject such attacks when appropriate. Id. at 1135. As Ray put it, the state court "was perfectly capable of taking jurisdiction and assessing whether [BGP's breach of contract claim] is precluded given that the sale already had been finalized and approved in the previous proceeding." Id. at 1136.
Ray emphasized this point by further noting:
Ordinarily both issue preclusion and claim preclusion are enforced by awaiting a second action in which they are pleaded and proved by the party asserting them, and the first court does not get to dictate to other courts the preclusion consequences of its own judgment.
Id. at 1135 (internal quotation marks omitted) (citing Charles A. Wright, Arthur R. Miller & Edward H. Cooper, FEDERAL PRACTICE & PROCEDURE § 4405 (2d ed. 1988)).
Finally, Ray determined that the bankruptcy court did not have ancillary jurisdiction over the breach of contract lawsuit. Id. at 1136. Ray acknowledged that ancillary jurisdiction generally is available when it is necessary for the bankruptcy court to interpret or effectuate its prior orders. But Ray, in essence, ruled that ancillary jurisdiction does not allow the bankruptcy court to try a post-confirmation breach of contract lawsuit when the lawsuit did not invoke substantive bankruptcy law rights, did not raise any bankruptcy law issues, and could not affect the estate or the debtor (because the bankruptcy proceedings already had run their full course and the debtor already had received his discharge). Id.[9]
*567 Ray compels us to hold that the bankruptcy court here lacked jurisdiction over the Kirton Parties' Petition. The Petition contained no causes of action based either on substantive bankruptcy law or on rights created in the course of the bankruptcy case. To the contrary, the respondents' alleged obligations arose, according to the Petition, from the Retirement Plan and the California Constitution. Thus, these alleged obligations on their face arose (if at all) independent of and prior to VHS's bankruptcy filing.
Nor did the Petition raise any bankruptcy law issues. The Petition does not even mention VHS's bankruptcy case. There is only one apparent connection between the Petition and the bankruptcy case: the potential preclusive effect of the claims bar date, the confirmed plan, and the plan confirmation order on the causes of action stated in the Petition. Ray made it abundantly clear that this potential preclusive effect does not by itself confer any sort of subject matter jurisdiction on the bankruptcy court. Ray, 624 F.3d at 1135. As Ray put it, the state court is "perfectly capable" of assessing the preclusive effect of the bankruptcy court's prior orders and rulings, id. at 1136, and the bankruptcy court "does not get to dictate to other courts the preclusion consequences of its own [rulings]." Id. at 1135.
Because neither the Kirton Parties nor the VHS Defendants discussed either Ray or Wilshire Courtyard in their appeal briefs, we issued an order giving the parties the opportunity to file supplemental briefs discussing the impact of these cases on this appeal. In its supplemental brief, the VHS Defendants asserted that this matter meets Pegasus Gold Corp.'s "close nexus" test (and is distinguishable from Ray) because the Kirton Parties' Petition could have a profound impact on VHS's Chapter 9 Plan. The VHS Defendants further asserted that the bankruptcy court had jurisdiction because here, unlike in Ray, the Petition did not raise solely state law issues but also raised bankruptcy law issues. Finally, the VHS Defendants claimed that Ray is distinguishable because, there, the debtor's plan had been fully administered and the bankruptcy case closed, whereas here the plan has not been fully administered and the case is still open. We will address each of these contentions in turn.
As we indicated above, the VHS Defendants' close nexus argument hinges on the impact they say the Petition might have on the Chapter 9 Plan. According to the VHS Defendants, this potential impact distinguished Ray because the Ninth Circuit in Ray concluded that BGP's state court lawsuit "would have had no impact on the debtor, its property or the implementation of its plan."[10]
However, we disagree with the VHS Defendants' interpretation of Ray. It ignores Ray's pivotal comments on the role the state court must play in deciding what preclusive effect (if any) to give to the bankruptcy court's prior rulings. Id. at 1134 n. 7, 1135. Simply put, we acknowledge that, if the state court here does not *568 give the bankruptcy court's prior rulings preclusive effect, the Petition may impact VHS, its Chapter 9 Plan, or other creditors. But Ray acknowledged similar concerns, and yet left the preclusion issues squarely in the hands of the state court.[11]
We also disagree with the VHS Defendants' second argument, that the bankruptcy court had jurisdiction because the Kirton Parties' Petition raised bankruptcy law issues. To the contrary, the Petition was based solely on state-law rights allegedly arising from the Retirement Plan and the California Constitution, rights that arose (if at all) prior to and wholly independent of VHS's bankruptcy case. That VHS ultimately might want to assert as a defense to the Petition rights it acquired in the course of its bankruptcy case is of no moment. As we stated above, the focus in determining the bankruptcy court's removal jurisdiction is on the well-pled allegations of the Petition and not on any defense the VHS Defendants anticipate they might want to assert in response. See In re Miles, 430 F.3d at 1088.
The VHS Defendants also attempt to distinguish Ray by comparing the status of VHS's Chapter 9 Plan and the status of its bankruptcy case with the status of Ray's chapter 11 plan and his bankruptcy case. In Ray, at the time BGP sued Ray and others in state court for breach of BGP's first refusal rights with respect to the sale of the Adjacent Land, Ray's plan had been fully administered and his bankruptcy case had been closed. 624 F.3d at 1129. In contrast, according to the VHS Defendants, distributions under VHS's Chapter 9 Plan are in progress now, and its bankruptcy case is still open. However, in terms of finding (or not) the requisite close nexus between the Petition and VHS's bankruptcy case, the current status of the VHS bankruptcy case and the Chapter 9 Plan simply are not critical under the circumstances.[12] Rather, under the facts of this case, it is the entry of the court's confirmation order (and any preclusive effect that order and the Chapter 9 Plan might have) that are crucial in considering the potential impact of the Petition on VHS's bankruptcy case. In short, the distinctions that the VHS Defendants have pointed to are not significant for purposes of ascertaining whether "related to" jurisdiction exists here.
Nor can these case status and plan status distinctions support a conclusion that ancillary jurisdiction exists. Ray stands for the proposition that there can be no ancillary bankruptcy jurisdiction (nor any other type of bankruptcy jurisdiction) in a postconfirmation breach of contract lawsuit, when the complaint does not raise any issues of bankruptcy law, does not invoke any rights either based on substantive bankruptcy law or created in the course of the bankruptcy case, and does not impact the debtor, the estate or the plan. In other words, there can be no ancillary jurisdiction over an action when the action in question is not sufficiently connected to a prior action over which the court had jurisdiction. See Fed. Sav. & Loan Ins. Corp. v. Ferrante, 364 F.3d 1037, 1041-42 (9th Cir.2004). In light of Ray, we cannot find here that there is *569 sufficient connection between the Petition and VHS's bankruptcy case to establish that the bankruptcy court had ancillary jurisdiction over the Petition.
We also note that the Chapter 9 Plan included lengthy and broad jurisdiction retention provisions. Among other things, the plan purported to have the bankruptcy court retain jurisdiction: "to hear and determine all disputes or controversies arising in connection with or related to this Plan or the Confirmation Order or the interpretation, implementation, or enforcement of this Plan or the Confirmation Order or the extent of any entity's obligations incurred in connection with or released under this Plan or the Confirmation Order." Chapter 9 Plan (Dec. 17, 2009) at 26:14-17. Notwithstanding the above, Ray ruled that a jurisdiction retention provision, by itself, cannot confer jurisdiction on the bankruptcy court. See In re Ray, 624 F.3d at 1136 n. 8.
Even though the Kirton Parties never filed a remand motion, they did not waive the argument that the bankruptcy court lacked subject matter jurisdiction; the Kirton Parties could make that argument, and did make that argument, at other times during the course of the proceedings and on appeal. See O'Halloran, 856 F.2d at 1379 (stating that an argument regarding the court's subject matter jurisdiction could not be waived and could be raised at any time).[13]
Accordingly, because the bankruptcy court lacked subject matter jurisdiction over the removed Petition, we must VACATE its judgment dismissing the Petition under Civil Rule 12(b)(6).

CONCLUSION
For the reasons set forth above, we VACATE the bankruptcy court's order under Civil Rule 12(b)(6) dismissing the Kirton Parties' Petition because it lacked subject matter jurisdiction over this dispute. We REMAND this matter to the bankruptcy court with instructions to remand the Petition to the state court.

Appendix
California Constitution Art. XVI, Sec. 17, provides in part:
Notwithstanding any other provisions of law or this Constitution to the contrary, the retirement board of a public pension or retirement system shall have plenary authority and fiduciary responsibility for investment of moneys and administration of the system, subject to all of the following:
(a) The retirement board of a public pension or retirement system shall have the sole and exclusive fiduciary responsibility over the assets of the public pension or retirement system. The retirement board shall also have sole and exclusive responsibility to administer the system in a manner that will assure prompt delivery of benefits and related services to the participants and their beneficiaries. The assets of a public pension or retirement system are trust funds and shall be held for the exclusive purposes of providing benefits to participants in the pension or retirement *570 system and their beneficiaries and defraying reasonable expenses of administering the system.
(b) The members of the retirement board of a public pension or retirement system shall discharge their duties with respect to the system solely in the interest of, and for the exclusive purposes of providing benefits to, participants and their beneficiaries, minimizing employer contributions thereto, and defraying reasonable expenses of administering the system. A retirement board's duty to its participants and their beneficiaries shall take precedence over any other duty.
(c) The members of the retirement board of a public pension or retirement system shall discharge their duties with respect to the system with the care, skill, prudence, and diligence under the circumstances then prevailing that a prudent person acting in a like capacity and familiar with these matters would use in the conduct of an enterprise of a like character and with like aims.
(d) The members of the retirement board of a public pension or retirement system shall diversify the investments of the system so as to minimize the risk of loss and to maximize the rate of return, unless under the circumstances it is clearly not prudent to do so.
(e) The retirement board of a public pension or retirement system, consistent with the exclusive fiduciary responsibilities vested in it, shall have the sole and exclusive power to provide for actuarial services in order to assure the competency of the assets of the public pension or retirement system.
* * *
(h) As used in this section, the term "retirement board" shall mean the board of administration, board of trustees, board of directors, or other governing body or board of a public employees' pension or retirement system; provided, however, that the term "retirement board" shall not be interpreted to mean or include a governing body or board created after July 1, 1991 which does not administer pension or retirement benefits, or the elected legislative body of a jurisdiction which employs participants in a public employees' pension or retirement system.
NOTES
[**]  Even though Daniel Barness of Barness & Barness LLP filed with the BAP a calendar acknowledgment indicating that he would appear at oral argument to argue on behalf of Appellants Peggy Kirton and Diana Agnello, no one actually appeared at oral argument to argue on behalf of the Appellants. Accordingly, the panel deemed Appellants' position submitted on their briefs and on the record.
[*]  This disposition is not appropriate for publication. Although it may be cited for whatever persuasive value it may have (see Fed. R.App. P. 32.1), it has no precedential value. See 9th Cir. BAP Rule 8013-1.
[1]  Unless specified otherwise, all chapter and section references are to the Bankruptcy Code, 11 U.S.C. §§ 101-1532, and all "Rule" references are to the Federal Rules of Bankruptcy Procedure, Rules XXXX-XXXX. All "Civil Rule" references are to the Federal Rules of Civil Procedure.
[2]  Neither the Chapter 9 Plan nor the accompanying first amended disclosure statement of even date were included in the parties' excerpts of record, but we have obtained copies of these and other bankruptcy court filings by accessing the bankruptcy court's electronic docket and the imaged documents attached thereto. We can take judicial notice of the contents and filing of these documents. See Atwood v. Chase Manhattan Mortg. Co. (In re Atwood), 293 B.R. 227, 233 n. 9 (9th Cir. BAP 2003)(citing O'Rourke v. Seaboard Sur. Co. (In re E.R. Fegert, Inc.), 887 F.2d 955, 957-58 (9th Cir.1989)).
[3]  The Kirton Parties sometimes referred to VHS as "Valley Health Systems." See Petition (Aug. 26, 2010) at ¶ 1; Appellants' Opening Brief (May 25, 2011) at p. 6 n. 4 (emphasis added).
[4]  The Kirton Parties sometimes identified the Retirement Plan as the "Valley Health Systems Retirement Plan." See Petition (Aug. 26, 2010) at ¶ 3 (emphasis added). At times, the Kirton Parties have argued that there might be two or more entities with similar sounding names and that some of these entities might not be independent of VHS while others allegedly are independent of VHS. However, the entirety of the record makes clear that there is only one relevant retirement plan, and that is the Retirement Plan, from which the Kirton Parties' retirement benefits allegedly arose. Indeed, the Kirton Parties have conceded on appeal that the document establishing the Retirement Plan is part of the record, attached as Exhibit 1 to the Declaration of Joel Bergenfeld, filed in support of VHS's Civil Rule 12(b)(6) motion to dismiss. See Appellants' Opening Brief (May 25, 2011) at 6:6-14.
[5]  Due to its length, we reprint California Constitution Art. XVI, Sec. 17, in an appendix to this memorandum.
[6]  Nor did the Kirton Parties ever file a motion for remand. Local Bankruptcy Rule 9027-1(c) provides: "A motion for remand must be filed with the clerk of the bankruptcy court not later than 30 days after the date of filing of the notice of removal."
[7]  Rule 9023 makes Civil Rule 59(e) applicable in adversary proceedings.
[8]  Beneficial Trust Deeds v. Franklin (In re Franklin), 802 F.2d 324 (9th Cir.1986); McCowan v. Fraley (In re McCowan), 296 B.R. 1 (9th Cir.BAP 2003); Aheong v. Mellon Mortg. Co. (In re Aheong), 276 B.R. 233 (9th Cir. BAP 2002); Haw. Airlines, Inc. v. Mesa Air Group, Inc., 355 B.R. 214 (D.Haw.2006).
[9]  Recently, this Panel followed Ray and held that a bankruptcy court lacked subject matter jurisdiction to hear post-confirmation contempt proceedings commenced by the general partners of the former debtor against the California Franchise Tax Board. In re Wilshire Courtyard, 459 B.R. at 434. In one sense, the Panel went further in Wilshire Courtyard than the Ninth Circuit did in Ray. In Wilshire Courtyard, the debtor's general partners commenced a contempt proceeding in the bankruptcy court expressly and directly seeking interpretation and enforcement of the bankruptcy court's confirmation order. In contrast, the subject action in Ray was a garden-variety state law breach of contract action that the non-debtor plaintiff had filed in state court. Yet we still held in Wilshire Courtyard that Ray was apposite and that the bankruptcy court lacked jurisdiction over the contempt proceeding. As we held in Wilshire Courtyard, the absence of substantive bankruptcy law issues and the dispute's lack of any potential effect on the debtor, the plan and the estate were dispositive. Id.
[10]  Appellee's Supplemental Brief (Dec. 15, 2011) at p. 12; see also id. at p. 13 (stating that dispute in Ray "would have had no impact on the debtor, its property or its ability to pay creditors"); id. at p. 14 (stating that the dispute in Ray "would have had no impact on the estate itself").
[11]  If, in the process of ruling on the Petition, the state court misinterprets the plan, the confirmation order or any of the bankruptcy court's other orders, VHS then might be able to seek relief from the bankruptcy court, provided that the state court's ruling implicates substantive bankruptcy law issues or impacts VHS or its plan. See Huse v. Huse-Sporsem, A.S. (In re Birting Fisheries, Inc.), 300 B.R. 489, 500-01 (9th Cir. BAP 2003).
[12]  See generally In re Ray, 624 F.3d at 1132 n. 5 (noting that whether the underlying bankruptcy case is open or closed does not control).
[13]  While we ultimately reach the same result as that urged by the Kirton Parties in their supplemental brief, that the bankruptcy court lacked jurisdiction over the Petition, the Kirton Parties asserted this result follows from the following facts: (1) they did not actively participate in VHS's bankruptcy case; (2) the Chapter 9 Plan stated that their Retirement Plan rights were unaffected; and (3) the Chapter 9 Plan deprived them the right to vote for or against the plan. It suffices for us to say that we disagree with the Kirton Parties' jurisdictional analysis and instead rely on our own analysis, which mirrors Ray's analysis.
