Ok so in bedrock edition 1.17.41 if you make a new world and the seed is "nan" you will spawn at a beach. You will see a weird cave. No big deal, So you hop in. THEN ITS LIKE SPAWN TO THE DANG WORLD BORDER!
Recreation-
Step 1: Make a new bedrock edition world with the seed "nan"
Step 2: You will see a big cave, Hop into this cave
Step 3: Explore the cave
And you did the glitched seed
I can't understand what you mean by "weird immense cave spawning". The seed that you provided looks as expected to me. If you mean that it's weird because such big cave was generated right beside the spawn point - that works as intended.
Closing for now. If you have any concerns, let me know here or create a new issue, this time describing it more clearly.