You must first understand what this caption feature provides. IMHO, it is a courtesy one-size-fits-all convenience offered for quick’n’dirty job. By this, I mean it is a compromise and may not fit exactly what you need or want, as exemplified by your question.
Insert
>Caption
creates a frame around the selected picture and adds a (styled) paragraph inside the frame above or below the image. You end up with a nested structure which is way too complicated in the majority of cases.
If i do it manually, I do it the other way round. I start by creating the caption paragraph (yes, it is more complicated because you must take care manually of the numbering by inserting the adequate field) because this paragraph has some relation with my surrounding text. Then I attach the image to the caption and I frame-style the image so that it has without any error all the desired wrap and position properties relative to the caption. In the end, my document has less frames and is more robust.
In your case, I’d anchor two images to the same caption paragraph and the frame style(s) would take care of the position. Above all, make sure that Allow overlap is not ticked. I think you need 2 frame styles because I seem to remember that the automatic conflict avoidance function repositions the image only in the vertical direction. Consequently, two style are probably needed to align images side by side, unless you opt for a table solution.
Remark: whatever you do, the Insert
>Caption
needs to anchor the outer frame to some element of your text. This ends up to some equivalent of my caption paragraph anchoring. You could object that the group caption+image is made independent from the text and this is preferable. However, Writer is lacking a “deferred” or “floating” anchor mode in which the frame would be flushed to next page if there is not enough space and text continues to flow up to the bottom of the page. Unfortunately, this is not possible presently and you have a rather high probability of annoying blank space at bottom of page.