The Prophet ﷺ visited Dubaa bint Zubayr bin Abdul-Muttalib, and she said, "I wish to perform the Hajj, but I am ill."The Prophet ﷺ replied, "Go on Hajj, and make the condition that I will exit my state of ihram wherever You hold me back."
حدثنا عبد الرزاق حدثنا معمر عن الزهري عن عروة عن عائشة وهشام عن أبيه
دخل النبي ﷺ على ضباعة بنت الزبير بن عبد المطلب فقالت إني أريد الحج وأنا شاكية فقال النبي ﷺ حجي واشترطي أن محلي حيث حبستني
Its isnad is sahih. Bukhari narrated it, 9/132, no. 5081, in the Book of Marriage, and Muslim, 2/867, no. 1207, and it has already been mentioned many times in similar wording.