You can also use an online time-lock service such as lockmeout.online to store the PIN for ScreenTime or assistive access (even better as it dumb down the UI).
Years ago I had this problem, but I didn't know about these services, so I had to keep the PIN data myself without being able to access it on a whim. I developed timelock for this purpose: https://github.com/rayanamal/timelock