I think that he just didnt belive Kirk was dead, consider that they would never have found aq body, and all the things Kirk had survived before, a small part of Scotty probably belived his old friend had survived, somehow.
Actually yes, Ron Moore said at the time that he knew this was an inconsistency, but that Scotty was included in the film out of simple affection for the character. I no longer remember where I read this, unfortunately. As for an "in-universe" explanation, it could be explained away that Scotty got lost in the transporter after Kirk "died" on the B, and 75 years in suspended animation scrambled his memory a little. Works for me.
No need to overthink this thing. Go with the "he was just confused for a moment" explanation and be done with it.
Keeping it out of the Shatnerverse, I think this could make for an interesting book. "Kirk's back in the 23rd century and he's pissed. One man, alone... This time...it's personal." Heh, heh...but no really: the tale could be seminal...the epic journey to save a comrade that didn't end in success. My God, Bones...what ever happened on that mission when the angels wept? I may try working this out in my head. How do you make the epic hero lose yet still win insofar as keeping the tale in the idealistic pantheon stories where the hero always wins?
If I have to be forced to accept that Generations occured, than I will go with this. ^ But in my mind, Generations was just another of Data's bizzare dream sequences and they just forgot to add the big reveal at the end. If Generations must exist, I think they should have ended it with Data waking up and hearing the sonic shower going, then cut to Kirk walking out, looking at Data and saying 'What iis it?' and Data replying with 'I have just had the strangest dream.', then fade to black. What the hell, it's worked before.