It's pretty much random, so matching numbers can happen. Engines and frames are numbered sequentially - engines or frames that needed rework were pulled off the line and the next ones in line used to assemble the next bike. Engine serial are usually higher than frames so presumably more engines than frames were reworked or scrapped.
Possibly some effort was made to match numbers on your bike for some unknown reason, there's no way to tell that I know of. I've heard of people asking Honda for info on particular bikes but they got no useful answer.