King Charles surprised guests by switching languages during a speech as he reflected on his special connection with Wales.