I see no one has responded to you on this, but the answer is unfortunately not known. In my experience researching markings, there is decently good information on common Inspector markings (though I still see initials that cant be easily identified), but there is still so much lost or forgotten concerning other found markings.
Hand carved markings are generally individuals marks and we can never really know if they were made during or after the war. These are sometimes the most interesting as they are unique and integral to the weapons history.
As you know what you have appears to clearly be stamped which leads one to infer this was done for a much more official reasons. It could be from the war, unit specific, or could even have been applied after the war by a museum or collector. Your theory of something like (Company H, 9th rifle/rgt) could be possible, if this is a specific unit you can identify check and see if you can document the use of the M1842 within their ranks. I would start there.
Are there any other markings elsewhere on the stock or other parts?
As I have been told when asking about markings previously, "We may never know".