The ball off the crossbar starts a new phase of play, so not offside.
I think it has to be done that way else you’d have arguments about how far back you have to check for offside calls.
Unless of course you go back to the old rules in which offside is always called even if you aren’t involved in the play.