ffmpeg wants to overwrite existing images
Solution 1:
You need to tell the image file demuxer to interpret the pattern like a glob and add quotes around the pattern:
ffmpeg -pattern_type glob -i "*.jpg" -c:v libx264 -pix_fmt yuv420p \
-movflags +faststart output.mp4