Yet Another Bootloader Failure

Disclaimer: I have looked at various bootloader error topics, but most of them seem to be about plucking the microcontrollers off Arduino boards or lack of resistors on the reset pin. Also, this is my first post on the forum, I hope I am not breaking any rules.

Now that I have sorted that out, let me explain my problem. I am making a project in which an actual Arduino board would be too big to fit inside the chassis. For this reason, I have bought three Atmega328 chips from an electronics market in Izmir, with no bootloader on them. I know for a fact that they do not sell bad products, so that should not be the problem. I have followed various instructions from the internet about making a breadboard Arduino, and tried most of them, including Arduino's own method that uses the ArduinoISP sketch. I upload the ArduinoISP sketch onto my Arduino Leonardo,and I connect the hardware as shown in the graphic, including the 16k crystal, load capacitors, and the resistor on the reset pin. After that, I choose Arduino Nano as the target board, use programmer "Arduino as ISP", and select "burn bootloader". But this gives me the infamous error:

avrdude stk500_getsync() not in sync resp=0x03

I tried other methods using FTDI and USB-TTL, getting the same error about not being in sync. I remember a long, long time burning bootloaders on atmega328 chips with something like optiboot but I can't remember how to do that either, and googling didn't help me much. Can someone please enlighten me? I will post attachments if necessary.

Try Nick Gammon's bootloader installer sketch.