Considering the mixed nature of reports of flexibility difficulties in autism, we hypothesized that a task that more closely resembles the challenges faced in real life would help to assess these difficulties. Autistic and typically developing adults performed an online Emotional Shifting Task, involving non-explicit unpredictable shifts of complex socio-emotional stimuli, and the Task Switching Task, involving explicit predictable shifts of simple character stimuli. Switch cost (i.e. the difference in performance between Shift and Non Shift conditions) was larger in the autistic group than in the comparison group for the Emotional Shifting Task but not for the Task Switching Task. Females responded faster than males in the Emotional Shifting Task. On the Task Switching Task, typically developing males responded faster than typically developing females, whereas there was a female advantage in the autistic group. Our findings suggest that factors such as predictability, explicitness of the shift rule, stimulus type as well as sex could play a critical role in flexibility difficulties in autism. Lay abstract Flexibility difficulties in autism might be particularly common in complex situations, when shifts (i.e. the switch of attentional resources or strategy according to the situation) are unpredictable, implicit (i.e. not guided by explicit rules) and the stimuli are complex. We analyzed the data of 101 autistic and 145 non-autistic adults, without intellectual deficiency, on two flexibility tasks performed online. The first task involved unpredictable and non-explicit shifts of complex socio-emotional stimuli, whereas the second task involved predictable and explicit shifts of character stimuli. Considering the discrepancies between laboratory results and the real-life flexibility-related challenges faced by autistic individuals, we need to determine which factor could be of particular importance in flexibility difficulties. We point out that the switch cost (i.e. the difference between shift and non-shift condition) was larger for autistic than for non-autistic participants on the complex flexibility task with unpredictable and non-explicit shifts of socio-emotional stimuli, whereas this was not the case when shifts were predictable, explicit and involved less complex stimuli. We also highlight sex differences, suggesting that autistic females have better social skills than autistic males and that they also have a specific cognitive profile, which could contribute to social camouflaging. The findings of this work help us understand which factors could influence flexibility difficulties in autism and are important for designing future studies. They also add to the literature on sex differences in autism which underpin better social skills, executive function, and camouflaging in autistic females.