I needed to directly pass the .net publish command my code sign identity and it finally could sign it: -p:CodesignKey="Apple Distribution: My Team Name (TeamID)"
So the Publish step looks like this now:
- name: Build iOS
run: dotnet publish ${{ inputs.project-file }} -c ${{ inputs.build-config }} -f ${{ inputs.dotnet-version-target}}-ios -p:ArchiveOnBuild=true p:CodesignKey="Apple Distribution: My Team Name (TeamID)" --no-restore