I assumed that you measured your old bolts with calipers. Your sketch shows that the threaded part had an OD of 4mm, which would make it an M4 bolt.
If you're guessing at the size, you're probably guessing wrong. Double check with a pair of calipers
Secondly, flat head cap screws are measured...