When flattening a shape and a stroke - for instance a circle outline and 4 rectangles creating a target.
pressing flatten should fist turn the stroke to an outline then attempt to flatten.
current behavior is unpredictable. my suggestion will create something that looks like merging shapes