The probably explanation of the miss-matched numbers is quite simple.
This is a 'trade' gun, bought in to fill a space on the rack. It probably was 'retailed' by William Moore & Grey but it is very unlikely that they 'made' it. The use of WM&G instead of the full name was simply to save a few more pennies.
The number on barrels and forend are most likely that of the manufacturer, probably Scott as they were working in the 40000 range in 1887 which is the last year of the proof marks.
The shorter 4001 number is more likely WH&G own serial number for their sales ledger.
Only guns made and finished in their entirety by a Maker are likely to have matching numbers on all parts. I see lots of good quality guns by well known makers that carry a range of numbers: barrel makers, actioners etc etc.

As a matter of interest, according to Nigel Brown (in person), the 'CHOKE' variant of the 'NOT FOR BALL' proof marks (with the two bore measurements) as we have here is a sign of ORIGINAL recessed (jug) chokes. Obviously, with recessed chokes there was no concern about people putting a solid ball through their gun and blowing the last few inches off the barrels so no need for the 'NOT FOR BALL'!
As it turned out, it was a non-problem anyway but that's progress for you!