Start with the passcode. The Screen Time passcode has to be different from the device's unlock passcode, and known only to you. If it is shared, guessed, or the same as the lock screen code, the child can simply turn restrictions off, which looks identical to a limit "not working."
Confirm the device is a managed child account, not an adult one. Screen Time restrictions are far easier to bypass on a device signed in with a regular Apple Account. Under Family Sharing, a child added as a managed Apple Account cannot approve their own Screen Time changes, cannot turn off Content & Privacy Restrictions, and cannot use "Ask to Buy" to route around App Store limits without your approval. If the child's iPhone was set up before Family Sharing, converting the account closes most of the common gaps at once.
A factory reset does not remove your restrictions if this is set up correctly. With Find My enabled on a managed child account, erasing and reactivating the device requires your Apple Account sign-in, so a reset alone will not strip Screen Time. If a full reset did remove restrictions, the account was likely not a properly managed child account.
Check for an unrestricted second device. A shared family iPad, an old hand-me-down iPhone, or a friend's device without the same restrictions gives the same apps an unrestricted route, which can look like "the limit isn't working" when the limit itself is actually fine on the intended device.