I decided to follow the First Steps guide page-by-page since it has been awhile and I’m on a new installation where the default preferences seem not how I remember (mouse’s edit behavior is particularly messing me up).
As I think @arco is suggesting, I’m guessing that you were in Note Input mode and had the caret in the middle of the bar when you input the key change – so Dorico obligingly put the key change in the middle of the bar.
If you want the key change at the beginning of the bar, you can do any of the following before invoking the popover with Shift+D:
The steps outlined in that part of First Steps tell you to select a rest before using the popover to add the key signatures.
I suppose this tip could be made even more specific, to clarify that the easiest way to add those key signatures is to select the barline or rest, but given that this comes before introducing the caret and note input, it didn’t seem a likely necessary clarification.
When using the caret, pay attention to where it’s positioned, as its exact position determines where items get input.
If your key signature changes occur at the start of a bar, ie at a barline position, then a double barline should indeed appear. Dorico won’t show a double barline if the key signature occurs mid-bar, which is hopefully reasonable.