Based on some digging through the limited primary source material that is available online, I have some doubts that this is verifiable. I also can't find a reference in any of the secondary materials that I have access to other than the un-cited Wikipedia entries. Note that the dates below shouldn't be used to build a timeline, given the fact that different regions were frequently days apart on the calendar (some documents from the period even use conventions such as 4/14 Oct.) The following is from a letter to John Thurloe, head of intelligence to Oliver Cromwell (my emphasis).
From Casimir before Cracow, October 4, 1655. O. S.
At this siege, nothing remarkable has happened, but only that the
besieged, this day, have made a beginning to capitulate; to that
purpose they have desired of his majesty of Sweden to grant them
Litteras salvi passûs for their deputies, which were immediately sent
them. Whereupon they have resolved to come hither to morrow morning at
eight o'clock, if it pleases God, to enter upon a treaty. This day the
treaty with the deputies of the Quartians is concluded; so that there
only now remains, that the same be confirmed by the pen, and signed by
his Swedish majesty, which, it is believed, may be done to-morrow.
It isn't clear who the author of the letter is, but Jan II Kazimierz may be a good candidate. Regardless, it appears to have been written the day before Kraków capitulated as it includes an intercept from Gustav:
To morrow, I hope, to have done with the city of Cracow, because they
capitulate already. With the most part of the Quartians I shall
likewise soon have concluded, and I expect first here Conjecz Polsky
and Wiesnowisky, who have entirely separated themselves from the
others, viz. from Podosky and Lands Coronsky. The great God grant me
further prosperous success, and assist us henceforth, as he has thus
far miraculously protected and blessed me.
None of Gustav's correspondence around the time makes mention of the event either, but that is to be expected - having one's horse shot out from underneath you is not horribly dignifying for a monarch. It also would not be that uncommon, but would still be noteworthy. This makes the event conspicuously missing in the Passages from the Diary of General Patrick Gordon (see pages 1655-6 from October 10-11). What is notable is that Gordon, a Scottish officer in the service of Gustav, records that his horse was shot from under him shortly before the surrender of Kraków. In the editor's paraphrase:
A fort-night afterwards, he was engaged, under his countryman General
Douglas, in the attack and route of a body of about 10,000 Poles, who
occupied certain heights from which they annoyed the Swedish foragers.
The assault was entrusted to Colonel Konigsmark, who, finding that 400
of the fugitives had taken refuge in a fortress, summoned them to
surrender at discretion. They complied, and were hanged to a man. In
this engagement, which cost the Swedes 1,600 men, Gordon had his horse
killed under him, and received a shot in the leg.
While I seriously doubt this is a "case of mistaken identity", it does show how relatively common this event was during warfare of the period. In that Gordon's diary is one of the minuscule number of surviving participant accounts it is entirely possible that Gustav had a horse shot from under him, and nobody except the residents of Kraków thought it terribly out of the ordinary during a military action.
If a reference does exist, it's likely a needle archived in a haystack somewhere and likely in an officer's memoir. I doubt an event like this would have made the dispatches of the Swedish life guard cavalry.