Look carefully at this line
uint32_t x = (uint32_t)cast1[5];
It literally says get the value at cast1[5] and upcast it to 32 bits ... clearly that is not what you wanted as that returns 1 lifted back as a 32 bit result ... which is exactly what you got.
What you wanted was the 32 bit value that starts a cast1[5] so you need a 32 pointer to that statement looks like this
(uint32_t)&cast1[5]
Okay now you don't want the pointer your want the value so you have to dereference it back
*((uint32_t)&cast1[5])
so the final result looks like
uint32_t x = *((uint32_t)&cast1[5]);
That is all very ugly but it did what you wanted and showed you the literal
The normal easier way and more readable way is to use a 32 bit temp pointer
uint32_t* dummyptr = (uint32_t*)&cast1[5];
uint32_t x = *dummyptr;
Any optimizing compiler will immediately recognize it can remove the dummy pointer so it cost you nothing it just makes the code more human readable.