I have used an approach with the Toggle and SharePoint Yes/No fields pretty regularly. Today I tried to rebuild a form using the exact same working function and keep getting errors that make no sense.
The form includes a toggle (control renamed to OBO) to indicate whether you are submitting a request yourself or on behalf of another user.
If the toggle remains unchecked (false), the current user's display name is added to a people picker field next to it, the display mode is "Display", and the label above the field indicates "Requested by".
If the toggle is checked (true), the "Requested by" label becomes "Requested on behalf of ", the display mode is "Edit" and becomes required.
Now, in the rebuild of the form, any action I try to take using the OBO toggle treats it as text instead of boolean. The form is using a duplicate of the original list, so all the fields are exactly the same. OBO is still a Yes/No field. Below are screenshots of the working and failing fields in their respective forms.
Still Working

Failing


This is the first row of the rebuild, so there is nothing else in the form that could be causing problems. I haven't even started adding code to the properties of the app, screen, form or other fields. This seems pretty simple and straightforward. No idea how it can be working in one form and not in another.