Since it doesn't relate to the other things we're discussing in the Comments we can go ahead and Answer the main query you posted here.
In which order should I glue, stain and apply epoxy resin?
The normal construction order would be:
- assemble — glue together in this case
- do any filling that's needed — epoxy in this case
- and then stain if you're intending to stain
- application of final finish as the last step.
You fill before staining because you generally have to do quite a bit of surface work — primarily sanding these days — to make fills flat and flush with the surface of the surrounding wood. If you stained first you'd just expose bare wood (irregularly) during this flushing work because the penetration of colouring agents into wood is usually very shallow1.
A quick note on making the epoxy flush
I would advise looking into scraping here if you don't already use scrapers. Scraping is something I promote as much as possible anyway2 but many experienced epoxy users swear by scrapers (of various types) to remove excess epoxy. I'm personally in favour of hand planing to get flush or nearly flush, followed by scraping or minimal sanding as needed, but would only recommend this if you already have a hand plane and know how to use it.
1 Even products promoted as having "deep penetration". This is only deep by comparison to other stains that penetrate even more shallowly!
2 Because scraping is better than sanding a lot of the time (faster, more efficient and leaves a better surface). Plus in the long term it is nearly unbelievably cheaper — one card scraper is equivalent to an almost infinite stack of sandpaper.