Or did the Supreme Court decide that the document, even though duly
signed, had no validity because it was issued on the basis of bad
I think that's about the size of it. In practice, the Government advises the Crown to prorogue and the Crown follows that advice. In this case, the Supreme Court found the advice was unlawful and ultimately therefore the prorogation was "unlawful, null and of no effect", therefore Parliament should behave as if it never happened. It was as if the document were "a blank piece of paper".
From the Supreme Court judgment R (on the application of Miller) (Appellant) v The Prime Minister (Respondent), Cherry and others (Respondents) v Advocate General for Scotland (Appellant) (Scotland)  UKSC 41:
3 Prorogation is a prerogative power exercised by the Crown on the advice of the Privy Council. In practice, as noted in the House of
Commons Library Briefing Paper (No 8589, 11th June 2019), “this
process has been a formality in the UK for more than a century: the
Government of the day advises the Crown to prorogue and that request
is acquiesced to”. ... Under current practice, a proclamation is made
by Order in Council a few days before the actual prorogation,
specifying a range of days within which Parliament may be prorogued
and the date on which the prorogation would end. The Lord Chancellor
prepares a commission under the great seal instructing the
Commissioners accordingly. On the day chosen for the prorogation, the
Commissioners enter the House of Lords; the House of Commons is
summoned; the command of the monarch appointing the Commission is
read; and Parliament is formally prorogued.
69 [with regard to this prorogation] That advice was unlawful. It was outside the powers of the Prime Minister to give it. This means that
it was null and of no effect: see, if authority were needed, R
(UNISON) v Lord Chancellor  UKSC 51, para 119. It led to the
Order in Council which, being founded on unlawful advice, was likewise
unlawful, null and of no effect and should be quashed. This led to the
actual prorogation, which was as if the Commissioners had walked into
Parliament with a blank piece of paper. It too was unlawful, null and
of no effect.
70 It follows that Parliament has not been prorogued and that this court should make declarations to that effect. ...
judgment in PDF format on Supreme Court's website, along with video recordings of the hearings:
(Cherry is listed separately at https://www.supremecourt.uk/cases/uksc-2019-0193.html but the cases were heard together and there was one judgment.)
judgment in HTML format on BAILII https://www.bailii.org/uk/cases/UKSC/2019/41.html