The hypotheses above are very strong, and they impose strong hypotheses on the cohomology of the complement $U$ of the universal hyperplane section. Using Leray spectral sequences for both projections, this quickly gives the result. Denote the dimension of $X$ by $n$, and denote by $m$ the dimension of the ambient projective space $\mathbb{P}^m$$\mathbb{CP}^m$ in which $X$ is embedded as a linearly nondegenerate variety.
Proposition. Assume that for every hyperplane $L$ in $\mathbb{P}^m$$\mathbb{CP}^m$, the intersection $H=L\cap X$ is a Cartier divisor in $X$ such that the open complement $X\setminus H$ is isomorphic to $\mathbb{C}^n$. Then $n$ equals $m$, and $X$ equals all of $\mathbb{P}^m$$\mathbb{CP}^m$.
Proof. Denote by $\widehat{\mathbb{P}}^m$$\widehat{\mathbb{CP}}^m$ the dual projective space of hyperplanes $L$ in $\mathbb{P}^m$$\mathbb{CP}^m$. Consider the following closed subset $Y$ of $X\times \widehat{\mathbb{P}}^m$$X\times \widehat{\mathbb{CP}}^m$, $$Y :=\{(x,[L])\in X\times \widehat{\mathbb{P}}^m : x\in L\}.$$$$Y :=\{(x,[L])\in X\times \widehat{\mathbb{CP}}^m : x\in L\}.$$ By hypothesis, the open complement $U$ of $Y$ in $X\times \widehat{\mathbb{P}}^m$$X\times \widehat{\mathbb{CP}}^m$ is an affine space bundle over $\widehat{\mathbb{P}}^m$$\widehat{\mathbb{CP}}^m$. By the Leray spectral sequence for cohomology applied to the second projection, $$\text{pr}_2:X\times \widehat{\mathbb{P}}^m \to \widehat{\mathbb{P}}^m,$$$$\text{pr}_2:X\times \widehat{\mathbb{CP}}^m \to \widehat{\mathbb{CP}}^m,$$ the cohomology of $U$ equals the cohomology of $\widehat{\mathbb{P}}^m$$\widehat{\mathbb{CP}}^m$. In particular, the cohomological dimension of $U$ equals $2m$.
On the other hand, we also have the first projection, $$\text{pr}_1:X\times \widehat{\mathbb{P}}^n \to X.$$$$\text{pr}_1:X\times \widehat{\mathbb{CP}}^m \to X.$$ The restriction of $\text{pr}_1$ to $U$ is again an affine space bundle, but now of relative dimension $m$. Thus, the cohomology of $U$ also equals the cohomology of $X$. In particular, the cohomological dimension of $U$ equals $2n$. Thus
Since the cohomological dimension of $U$ equals both $2n$ and $2m$, the dimension $n$ of $X$ equals the dimension $m$ of the ambient projective space $\mathbb{P}^m$. Therefore $X$ equals $\mathbb{P}^m$. QED
If this cardinality is nonzero, then there are hyperplane sections with varying Euler characteristics, and thus there open complements also have varying Euler characteristic. When the cardinality of the discriminant set equals $0$, then $X$ has defective dual variety, sometimes also called "defective discriminant variety", "degenerate dual variety", "degenerate discriminant variety", etc. Starting
Starting with Griffiths-Harris, then Ein, etc.and then many others, thesevarieties with defective dual variety have been classified in low dimensions. One general result proved by Beltrametti-Fania-Sommese is that every such variety admits a Fano fibration (possibly with base equal to a point) whose general fiber is a Fano manifold that also has defective dual variety. However, for a general hyperplane section $H$, since $H$ is irreducible (I am assuming that $\text{dim}(X)\geq 2$ since the result is trivial in dimension one), the exact sequence of Picard groups gives $$\mathbb{Z}\cdot [H] \to \text{Pic}(X) \to \text{Pic}(X\setminus H) \to 0.$$ By your hypothesis that If $X\setminus H$ is affine space for a general hyperplane section $H$, it follows thatthen $\text{Pic}(X\setminus H)$ is zero. Thus, $\text{Pic}(X)$ equals $\mathbb{Z}\cdot [H]$. If the target of the fibration has positive dimension, then the pullback of an ample divisor class from the target contradicts that $\text{Pic}(X)$ equals $\mathbb{Z}\cdot [H]$. Therefore,
if $X$ is a variety with defective dual variety such that $X\setminus H$ is an affine space for a general hyperplane section $H$, then $X$ is a Fano manifold (hence simply connected) with Picard rank $1$ and with equal Betti numbers to projective space of the same dimension.
By a theorem of Fujita and Libgober-Wood, the only fake projective spaces of dimension $\leq 6$ that are simply connected are honest projective spaces. In conclusion, for a smooth projective variety $X$ of dimension $n\leq 6$, if $X$ has dual defective variety and if $X\setminus H$ is isomorphic to affine space for a general hyperplane section $H$ of $X$, then $X$ is isomorphic to projective space, and $H$ is a general linear hyperplane in that projective space.