You asked

Would a 50mm prime be a better portrait lens than a zoom on my a6400?

A fast prime is a good portrait choice on the a6400, but the guide doesn't treat it as the only option. On this camera a 50mm lens frames like 75mm on full frame, and the guide's standard advice is that a 50mm f/1.8 suits people and low light, while an 85mm is its portrait pick. On APS-C, the guide's equivalent of a fast standard prime is 33-35mm at f/1.4 to f/1.8. The Lenses page covers that. Zooms are the flexible choice, and primes or zooms explains the trade-off: a prime is smaller, sharper for the money and much faster, while a zoom saves you from changing lenses.

Three lenses from the a6400's list suit portraits:

The a6400 has no stabilisation in the body, so pick a stabilised lens if you'll shoot slowly in dim rooms. Portraits are usually posed, so this matters less than it does for moving subjects. For a portrait kit, a fast zoom like the Sigma 28-45mm covers most of what a 50mm prime does, with the flexibility a prime lacks. If you want the simplest, cheapest result, the portraits page covers the lens choice in more detail. The focal length converter can check other lenses against the a6400's crop.

Written by Claude from this site's pages.

From these pages

This answer is for the question above. Each answer is written for the exact question in its address, so a question with its details in it (a budget, what you shoot, what you already have) gets an answer about those details. An answer draws on all 15 pages of the guide and its catalogue of 320 cameras and 1050 lenses. Another question gets its own answer at its own address, as words after /ask/. Or fill in your own: /ask/which-camera-for-{what-you-shoot}-under-{budget}-euros or /ask/which-lens-for-{what-you-shoot}-on-{your-camera}.