Thank you for your feedback.
Unfortunately exactly this code does not work for me.
When I switch to "Internal Oscillator" in "Config Tools" -> "Clocks", it generates a code whic hstill contains the calls to
XTALOSC24M->OSC_CONFIG2 |= XTALOSC24M_OSC_CONFIG2_ENABLE_1M_MASK;
XTALOSC24M->OSC_CONFIG2 &= ~XTALOSC24M_OSC_CONFIG2_MUX_1M_MASK;
CLOCK_SetXtalFreq(24000000U);
CLOCK_InitExternalClk(0);
But no matter if I leave them or comment them out as in your code, the application then dies at CLOCK_SwitchOsc(kCLOCK_XtalOsc) - or to be more specific it dies at
XTALOSC24M->LOWPWR_CTRL_SET = XTALOSC24M_LOWPWR_CTRL_SET_OSC_SEL_MASK;
