Unfortunately, QGIS does not treat geometry like any other attribute of a feature class - it should, but it doesn't.
A possible workaround is to create a field, e.g. a uuid field. Do not use the UUID generator widget type, use a text edit. Make the widget uneditable. Set constraints of the field to NOT NULL and 'enforce constraint'.
Under default value use overlay_intersects() expression or similar to check the current point feature is within your target polygon. Be aware that depending on how you use overlay_intersects() it may return a boolean or an array. (Check out the syntax and options for overlay_intersects() in the manual). Assuming your point can be within any polygon of your target layer, you can simply use overlay_intersects('myTargetLayer'), which returns a boolean: true if it is inside a polygon, false if not. You can then put this in a case statement something like
when overlay_intersects('myTargetLayer') then uuid()
If the expression returns null, then you will not be able to save the feature.
Screenshots of it working. In this case I am using tree_pt as my point layer and tgtnote_ar as my polygon layer. For 'tree_pt' I have a text field with default set to
when overlay_intersects('tgtnote_ar') then uuid
(Note: the 'when' clause, could be written as when overlay_intersects('tgtnote_ar') = True then uuid, but the '= True' is implicit.)
I have constraints set to 'Not null' and 'Enforce not null constraint' checked.
Here is a short GIF of it working. First two attempts at plotting a point are outside of a polygon: the feature form opens but can't be saved. Third attempt is inside a polygon. The feature form opens and the save button is enabled - I save the feature.