Let $k$ be a number field and $\mathbb{G}_m$ be the multiplicative group sheaf. For an algebraic group $G$, we define the character group $\widehat{G}:= \mathrm{Hom}_{\bar{k}}(\bar{G},\mathbb{G}_{m,\bar{k}})$, where $\bar{G}$ is the base change to an algebraic closure of $k$. This is a contravariant functor and I believe that it is right exact since $\mathbb{G}_{m,\bar{k}}$ when viewed as a group is divisible.
Now suppose we have the following exact sequence of algebraic $k$-groups
$$0 \rightarrow T \rightarrow S \rightarrow A \rightarrow 0,$$
where $T$ is a torus and $A$ an abelian variety. Applying the character group functor we get
$$0 \rightarrow \widehat{A} \rightarrow \widehat{S} \rightarrow \widehat{T} \rightarrow 0$$
if nothing I did above is wrong. Since $A$ is an abelian variety, it has no non-constant morphism to the affine variety $\mathbb{G}_{m,\bar{k}}$ and since such a character has to be a group homomorphism, we must have $\widehat{A} = 0$.
This will leave us with $\widehat{S} \cong \widehat{T}$ which is strange to me. Furthermore, doesn't the group $\mathrm{Ext}^1_{\bar{k}}(\bar{A},\mathbb{G}_{m,\bar{k}})$ contain all extensions of $\bar{A}$ by $\mathbb{G}_{m,\bar{k}}$ which are classes of semi-abelian varieties? Why do we only have the trivial extension in this case?
I'm not sure what could've possibly went wrong. Could it be that taking the functor does not actually give rise to an exact sequence in the first place? Pretty sure I've seen something similar done for taking character groups, but maybe I didn't apply it correctly.