Safe/unsafe is not the way to think about it. When you apply devices like inversion or retrograde you needed to assess the outcome, and whether it's musically useful, or how to make the outcome useful.
Depending on the details, when something is transformed by inversion or retrograde you get a kind of musical "opposite" harmonically, rhythmically, or melodically.
If you chromatically invert a plain major scale you get a phrygian scale. Similarly, if you chromatically invert a C
major chord, you get an F
minor chord. The inversions transform the mode, and in the later case change the chord root. None of those transformations is bad, or unsafe, per se, but you need to decide how they can be worked into the overall piece.
In terms of functional chord progression such transformations can result in retrogressions, where the normal function progression of IV V
is reversed to V IV
, which is normally a "problem" in functional harmony. That doesn't necessarily mean the transformation is completely bad, but you may need to reharmonize it, or reposition it within the key to make it work as good functional harmony.
Similar effects will come to play with melodic contour. If a line that follows the common "arch" contour is inverted, it of course becomes a drop down to a low point and then rises back up, an inverted arch. Not necessarily a problem, but you may need to figure out how to fit it into the whole piece. Also, if the top notes of a melodic line are more important to its good design, then inversion will take lower, subordinate pitches and put them into the high position, and the result may not be a good melodic contour.
Once I tried to invert the first 8 measures of Over The Rainbow and I heard the problem with melodic contour which can result from inversion. The lower pitches of the original line, those on the words "some" and "way", which are subordinate in the original, became too prominent in the inversion.
The top pitches of the original gently trace out a descending major scale, but when inverted, instead of getting a gradually ascending scale, the two C
s I circled in red become too prominent and ruin the melodic contour. The repeated pitches create a static line rather than a ascending one. That doesn't mean the inversion is totally unusable. I decided to move those pitches, and the E5
to chord tones low enough to not interfere with the contour of an ascending scale.
So, if you're hoping that some function in LilyPond will invert or reverse lines and automatically create great musical output, that is not likely to happen. You should expect to work further the output of those functions to figure out how to make good music from it. Also, be aware of the specific kinds of transformations LilyPond has built in and it may not automate all possible options. You may need to do some transformation manually.