The use of sharps versus flats used for various key signatures is known as enharmonic preference. Essentially an A♯ is sonically the same as a B♭. OnSong determines this enharmonic preference based on the key in which the song is to appear. For instance, the key of G is a sharp key containing one sharp note, an F♯. However is the song is written in another key that has an accidental note that would transpose into an A♯ or B♭, the result with be an A♯ in order to maintain the enharmonic preference of the key of G.
The one exception to this rule is the key of C. While the key of C has no sharps or flats, it's technically a flat key. So if there's an A♯ or B♭, the result would normally be to choose a B♭ to match the enharmonic preference of the key. You can change this globally in Settings ⮕ Display Settings ⮕ Song Formatting ⮕ Enharmonic ⮕ Enharmonic Preference.
As you can see, OnSong's transposition engine needs to know desired key in order to calculate the enharmonic preference. That's why when you write a song in OnSong, you should declare the key in which the song is written. A common cause of transposition issues is that if OnSong doesn't find a declared key using the "Key:" tag, then it will use the first chord found in the song. If you have a song that doesn't start on the root or tonic of the key, then you could run into issues when transposing. In addition, when you set a capo onto a song, the transposition engine has to calculate the key that you are attempting to transpose into. For instance, if you are playing in the key of A♭, you may want to place a capo on the first fret so you can play chords in the key of G. OnSong should then use chords with sharps.
In songs with few flats and sharps in the key signature, you should never run into double sharps or double flats. However the combination of some keys, improperly written charts, and capo can cause some strange things to happen. For instance, an F may be transposed and displayed as an E♯ or a C note as a B♯. OnSong has a feature to protect us mere mortals from this music theory exercise by preferring "natural notes". In other words, OnSong will attempt to convert these back into sane versions if it happens.