I wouldn't say it's common, but yes, it's a part of Chinese folklore, specifically Buddhism, that would spread to Japan and become part of Japanese folklore as well.
For those of you who doesn't use the app-
[1] Swordsman
[2] Thunder Cultivator
[3] Earth Cultivator
[4] Fire Cultivator
[5] Water Cultivator
[6] Wood Cultivator
[7] Wind Cultivator
Good thing he can only try once a day. In games where stat rerolls are a thing at the start I usually got so used to clicking reroll that I would reroll a good stat on accident.