Regardless of the mechanism that has introduced a ScreenTime/Restrictions passcode to your iPad, the method of its removal or reset is the same. One of the two procedures outlined here will resolve the problem:
If you forgot your Screen Time passcode - Apple Support
If your iPad is capable of supporting iPadOS 13.x, you must update to the most current version before attempting to resolve a forgotten ScreenTime passcode. The most recent iPadOS updates have introduced a new mechanism whereby a forgotten ScreenTime passcode can be reset without wiping the iPad.
To reset a forgotten ScreenTime/Restriction passcode on older versions of iOS, the iPad must be reset “as new”, losing all locally stored data. In this situation, you’ll not be able to restore your data from an iCloud or iTunes backup - as the forgotten passcode is integral to the backup; restoring from backup will restore the unknown passcode.
I hope this information is helpful to you in successfully resetting your forgotten passcode.