sounds like your boiler may need serviced. I have seen some boiler do that on shutdown but your pilot flame is probably weak and lazy, where a clean pilot would most likely not go out. have it serviced
Shut off the electrical switch from your heating unit then open the cover to your boiler check under the boiler if all the tubing where the fire goes is set properly on the slot in the back because if one of that tube was pitch down? that will cause to blow the pilot light every time the flame on the tube was shut off.Good luck....