Many people think that being unable to lie is a common trait in autistic individuals. Some autistic people might struggle with certain parts of talking and being with others, like understanding social hints or the tricks of lying. Some might speak very literally and find it tough to understand or do dishonest things, while others might not have a problem with lying.
Just like people who aren't autistic, autistic people have all kinds of personalities, experiences, and ideas about what's right and wrong that can affect if they lie or not. One reason people believe this myth is because some autistic people speak very literally.
I find it really hard to say I like something when I don't. I remember going to a wedding when I was a kid. I didn't like the bride's dress, and every time someone said she looked beautiful, I said what I really thought, which didn't go down well. Luckily, I was young enough that people found it cute.
As a kid, I struggled to follow scripts when I was acting, even though I enjoyed it. When I was nine, I played the innkeeper in a play about the nativity. We had a big stage setup, and I had to open a big door when Mary and Joseph knocked. Behind the door was a whole new area, and we hadn't rehearsed with it. So, when Joseph asked if there was room in the inn, I looked around at this new space and said, "Yes, there's plenty of room for you both, and I think the shepherds and wise men will fit too." Later, I felt really embarrassed, but I got so caught up in the new scenery that I forgot to stick to the script.
Another example of when autistic people might tell a lie is when they say something so crazy that it's meant to surprise someone. It's important for adults working with autistic kids to know if your child might do this. A friend of mine's son often tells wild stories about their home life just to see how people react. Luckily, their school knows about this, but it could be different if his mum didn't tell people about his tendency. There are lots of reasons why things like this happen, but I think it's often to shift the focus away from themselves and onto something else.
Like everything with autism, there is no one size fits all.