Hi DenisG,
I am not sure if I completely understand your requirement and if there is a different approach to this, but I can think of below logic (I am illustrating an example with fields of the account table below):
-----------------
Step 1 On Form custom JS level, iterate through all fields present on the form. //if needed, determine the linked entity you need to look for attribute metadata as well
Step 1. 1 For each field of the entity you need, you can query via web API if the field is mandatory like this: /api/data/v9.0/EntityDefinitions(LogicalName='{´LogicialNameOfTable')/Attributes(LogicalName='{LogicalNameOfField}')?$select=RequiredLevel
Step 1.2 Custom business logic
-----------------
Regarding 1.1, please check below some screenshots of my Vanilla environment.
My Column configuration on account entity:

Web API call and result for "name" column
/api/data/v9.0/EntityDefinitions(LogicalName='account')/Attributes(LogicalName='name')?$select=RequiredLevel

Web API call and result for "accountnumber" column
api/data/v9.0/EntityDefinitions(LogicalName='account')/Attributes(LogicalName='accountnumber')?$select=RequiredLevel

As you can see in my API call, I am leveraging the Column requirement level metadata property:
https://docs.microsoft.com/en-us/powerapps/developer/data-platform/entity-attribute-metadata#column-requirement-level
Hope that helps