Something like this would be illogical but reality based enough. Casemated barracks and ammunition storage built into the wall. You can ignore the steel fence and distant flanking position; the Germans stopped bothering with those features before the (first) world war anyway.
As for wall composition, for the core dry sand works stupid well against just about any possible threat. The rear wall would just be a revetment really, though the work above is one giant mass of stone covered in concrete buried into the backside of a hill and held the better part of a thousand men.
Block walls would be bad, that means they can be dislodged from each other by heavy impacts, though the use of blocks as permanent formwork is not impossible. Better to have a reinforced concrete wall, or something else solid like that which can be tied directly into the ground and the front wall, distances allowing. Otherwise even heavy caliber near miss blasts might lead to the wall blocks simply falling into a crater.
Of course its all about how much money you want to spend in reality, both making the model and in how the fortification is 'supposed' to be built. 40K seems too diverse for specific details to be critical. The need to place these back to back is a slight issue, since for example it'd be nice to have stairways to reach the top of the wall from ground level doors in the barracks. Though perhaps those could be recessed so that when back to back you'd have a slot? You would really want to avoid holes for access in the roof, since that creates a major vulnerability to high angle fire. The German casemate above was connected to other fighting positions and lengths of concrete trench via tunnels, so the doors which existed were mainly for resupply, not rushing out to fight. That's a HUGE issue with any kind of frontline shelter. Not letting it become a tomb.
If you wanted a really rugged look, a pain in the ass (it seems to me) thing to do would be a rear wall make of rock gabions in steel cages. Yes this has issues like blocks of being possible to knock loose, but its a little different. Functionally its scaling up a sand bag. They create a lot of spall when hit, but as long as the rock diameter is equal to the diameter of the impacting bombs or shells they are highly effective at deflecting projectiles, not just stopping them outright, and since you have some voids between the rocks you have a blast disspiating effect that is compounded by the immense strength of the steel cages which tends to hold them in place. You wire one cage to another of course, and the wire may be rather absurdly thick, and made of elastic steel.
The Israelis used such construction over 20ft thick on the Bar Lev Line as shown below. Heavy aircraft bombs and sustained artillery fire up to and including 240mm mortar rounds could not crack them. Hard to find good pictures online though. Under the piles of rock gabions were steel tubes for the actual shelters, with looted railroad rails used to form roof reinforcements. They fall somewhere in between permanent fortifications and field works. Depends I guess on how/where you think such a wall might be built. Afterall you might have no rear wall what so ever in any reality, just a slope of earth, but that back to back requirement rules against it.

"This cult of special forces is as sensible as to form a Royal Corps of Tree Climbers and say that no soldier who does not wear its green hat with a bunch of oak leaves stuck in it should be expected to climb a tree"
— Field Marshal William Slim 1956