It depends on what the roach was exposed to. Many (but not all) of the modern insecticides cause this. It may be due to the effect on the nervous system of the roach. The roach goes into spasms which will cause it to flip on its back. This is very apparent when contact insecticides, which are normally available over the counter, are used.