He stood up after two rakahs and the people said "subhan Allah" to alert him. He thought they were prompting him to say "subhan Allah" along with them, so he did and continued. Then he made two prostrations after the salam and said, "This is what we did with the Prophet ﷺ." The doubt was only regarding the saying of "subhan Allah."
حدثنا حجاج حدثني شعبة عن جابر الجعفي عن المغيرة بن شبل قال سمعته يحدث عن قيس بن أبي حازم
أنه قام في الركعتين فسبح القوم قال فأراه فسبح ومضى ثم سجد سجدتين بعدما سلم فقال هكذا فعلنا مع النبي ﷺ إنما شك في سبح
No references are available.
Its isnad is sahih. It was mentioned previously at 18065.