The guidance in the text is, in my view, oversimplified to the point of being incorrect.
Many idioms and fixed phrases are typically used in informal situations. For example "take a load off your feet" (or often just "take a load off") is quite informal. It should not be used in formal situations.
But idioms such as "Good things come to those who wait",
"We are going to break new ground", or "They are up in arms", are neither particularly formal nor informal, and may be used on occasions all across the range from very casual to quite formal.
Some idioms and fixed phrases such as: "I am going to play devil’s advocate", "May I have the pleasure of this dance?", or "I am so pleased to meet you" are used mostly in formal writing or on formal occasions. And some fixed phrases are used only on particular formal and ceremonial occasions.
I have the high honor, and distinct privilege, of presenting the President of the United States.
This is said by the Speaker of the US House of Representatives when the US President is about to address a joint session of Congress (a very formal occasion indeed) and at no other time.
Many ceremonies contain lots of fixed phrases. For example:
Do you, John, take Jessica, to be your lawfully wedded wife, to have and to hold, to love, honor, and cherish, as long as you both shall live?
I would also disagree with the text in saying that an idiom and a fixed phrase are the same thing. I would say that they are not.
The Wikipedia article "Set phrase" begins:
A set phrase (also known as a phraseme or fixed phrase) is a phrase whose parts are fixed in a certain order, even if the phrase could be changed without harming the literal meaning. This is because a set phrase is a culturally accepted phrase. A set phrase does not necessarily have any literal meaning in and of itself. Set phrases may function as idioms (e.g. red herring) or as words with a unique referent (e.g. Red Sea). There is no clear dividing line between a commonly used phrase and a set phrase. It is also not easy to draw a clear distinction between set phrases and compound words.
while the article on "Idiom" begins:
An idiom is a phrase or expression that typically presents a figurative, non-literal meaning attached to the phrase; but some phrases become figurative idioms while retaining the literal meaning of the phrase. Categorized as formulaic language, an idiom's figurative meaning is different from the literal meaning.
An article from study.com reads:
Fixed phrases are phrases in which the wording cannot be changed without sounding odd to native speakers, even if the literal meaning is the same.
Fixed phrases, as a category, also includes idioms, which are fixed phrases that mean something different from their literal definition. Just as with other fixed phrases, you cannot change the wording of idioms, even if the literal meaning would stay the same. Both idioms and other fixed phrases may be tested on standardized tests.
Not all fixed phrases take the form of idioms. Non-idiom fixed phrases tend to be more closely linked to their literal definitions than idioms. One English fixed phrase is 'of its own accord,' meaning 'on its own' or 'automatically.' As you can see, the meaning is closely matched to the literal definition. However, you still cannot substitute words. In the sentence 'The wagon moved of its own accord,' for example, you cannot say 'The wagon moved of its own ability.' This has the same literal meaning, but the phrasing is awkward.
Thus an idiom is a fixed metaphor or allusion, the meaning of which cannot be reliably determined from the meanings of the individual words. But a fixed phrase is a standardized expression with a fixed meaning, but that meaning can often be determined from the words of the phrase.
Idioms are a subset of fixed phrases. That is, all idioms are fixed phrases, but not all fixed phrases are idioms. But often "fixed phrase", is used to mean "a fixed phrase that is not an idiom".
I would agree that using idioms one does not well understand just to appear more fluent is often a mistake.
Therefore, when one learns an idiom, it is a good idea to learn in what situations and circumstances it is appropriate to use. This may include its level of formality, and will include its connotation as well as its denotation. It is often interesting to learn the origin or history of an idiom, but rarely is that essential to using it correctly.