[verb (plain)] + はずだ [i-adj] + はずだ [na-adj] + な + はずだ [noun] + の + はずだ
はずだ means "should be", "is supposed to be": the speaker expects something to be true and has a reason – a timetable, what someone said, how things normally go. It follows the plain form; a な-adjective keeps な and a noun takes の.
English "should" also gives advice. はずだ never does: advice is ほうがいい and duty is べきだ.
In the past, はずだった is "was supposed to": the plan was there, and it did not happen. はずではなかった is "this wasn't supposed to happen".
A past verb before はずだ is different: it is a confident guess about the past.