No, not if you get the correct permit.
I assume that you will get a wilderness permit from Inyo National Forest, either the office in Bishop or the Interagency Visitor Center in Lone Pine. Because of daily quotas, you may want to get this reserved online for a fee (recreation.gov). Anyway, if you tell them that you intend to start from Onion Valley and exit at Shepherds Pass, that will say so on the permit, and then you are legal for the whole trip.
If you were silly and told them something different, then the permit may not state all of that correctly. Permit writers have been known to get misunderstandings that show up on a permit.
Each of these jurisdictions has its own permits and quotas, but they acknowledge each others permits. In other words, if you have a legal national forest permit for Onion Valley to Shepherds Pass, some national park ranger will not hassle you.
–B.G.–