I wouldnt say thats a glitch since this also happen occasionally in BC2 inside the 4 thwomps place aswell. The best to do to test it would be to tape a replay in which we pass between a thwomp and a wall, and see on slow motion if the kart is really thin enough to pass(dont forget your kart can handle near ½ of a walls width before hitting it!) or if the game "bugs" like you said. But my guess would be that the kart is just thin enough to fit in perfectly between the thwomp and the wall.
As for the thwomps, they sure have no specific and repetitive pattern but I do believe that they arent 100% random. I explain: in BC3, on a 1'28-1'29 pace, 2nd lap seems to be the luckiest one 90% of the time with the 4 thwomps. 3rd lap generally appeared to be very unlucky(getting all 4 thwomps down 40-50% of the time), and same for 4th lap
if 3rd lap went nice. I havent made it enough times to 5th lap to be really sure but I can remember being relatively lucky with it, maybe a little less than 2nd lap.
I cant be 100% sure of this as it is obviously generality but 1 thing I can tell that rarely lies(still talking about 1'28-1'29 pace here), is to check when you begin a lap, those 2 first thwomps just before 2nd turn, 95% of the time when both were up(3rd and 4th lap), that was bad news for the 4 thwomps. But when they were down(2nd lap), I would have a bigger chance at the 4 thwomps and would at least get some of the 4 if not all 4 up.
The only thing that I would think to be 100% random with the thwomps would be their speed, in my opinion. How long they stay in the air and how long they take before going up(you know when you see a thwomp down, you expect it to go up quickly before you pass but damn, it just doesnt want to go up and you end up crashing in it(generally ½ sec before it finally goes up

)).
Anyway, so personally I think that its their speed mainly who get us to think they are totally random, but when you look at it carefully in one of the BCs, you notice some sort of generalized pattern depending on how fast you are.