Features limitations have been integrated into screen time since iOS12. There are a number of articles on the internet how to reset the four-digit . But wait a second! Do you turn on the Family Sharing feature? The passcode which you forgot is your child's functionality limit passcode!?
In that case, it is probably completely different from the method on the internet. The solution is really simple.
No matter how much you find in your child's iPhone, even if you look for the setting item, there is no setting items there. You have to look for your iPhone, not your children's iPhone. Only family shareing admin can unlock or reset children's passcode!
Select your child's iPhone from "Settings" > "Screen Time" on your iPhone, which is the administrator of Family Sharing.
Then, at the bottom, there is "Change the screen time passcode". You can change / reset the passcode from there.
If I had known, it is very simple. By the way, if you forget the old passcode, don't worry, you will not be asked to enter the old passcode.