Rugby rule error

The ball is kicked long bounces in the field of play and then goes out beyond the dead ball line, time is already up, should be game over instead you come back for an opposition scrum? That is wrong. I also lost the game because of this glitch